Commit 0ff50cb3 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by ntome

boilerplate: Fix for Python 3

parent 3640a2e7
Pipeline #2252 canceled with stages
...@@ -54,7 +54,8 @@ def main(): ...@@ -54,7 +54,8 @@ def main():
parser.add_argument( parser.add_argument(
'-e', '--email', '-e', '--email',
default=gitconfig('user.email'), type=u8) default=gitconfig('user.email'), type=u8)
subparsers = parser.add_subparsers() subparsers = parser.add_subparsers(dest='recipe')
subparsers.required = True
recipes_module = import_module('recipes', package='boilerplate_data') recipes_module = import_module('recipes', package='boilerplate_data')
...@@ -69,7 +70,7 @@ def main(): ...@@ -69,7 +70,7 @@ def main():
args = parser.parse_args() args = parser.parse_args()
recipe = args.recipe(args) recipe = args.recipe_class(args)
recipe.generate() recipe.generate()
......
...@@ -56,7 +56,7 @@ class Recipe(object): ...@@ -56,7 +56,7 @@ class Recipe(object):
def configure_subparser(cls, subparsers): def configure_subparser(cls, subparsers):
subparser = subparsers.add_parser(cls.NAME) subparser = subparsers.add_parser(cls.NAME)
subparser.add_argument('name', help='Module name') subparser.add_argument('name', help='Module name')
subparser.set_defaults(recipe=cls) subparser.set_defaults(recipe_class=cls)
return subparser return subparser
def __init__(self, args): def __init__(self, args):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment