style: Fixed lint problems in cli.py
This commit is contained in:
parent
78b9ebb020
commit
6d1f3a617a
@ -28,7 +28,7 @@ TEMPLATE_LOADER = Environment(loader=FileSystemLoader('templates'), trim_blocks=
|
||||
|
||||
class GrocyGroup(click.Group):
|
||||
def parse_args(self, ctx, args):
|
||||
is_subcommand = True if args[0] in self.commands else False
|
||||
is_subcommand = True if args[0] in self.commands else False
|
||||
if is_subcommand:
|
||||
ctx.forward(self.commands[args[0]], args[1:])
|
||||
super(GrocyGroup, self).parse_args(ctx, args)
|
||||
@ -230,6 +230,7 @@ def add(template):
|
||||
logger.error(e)
|
||||
raise e
|
||||
|
||||
|
||||
@main.group()
|
||||
@click.pass_context
|
||||
def recipe(ctx):
|
||||
@ -275,6 +276,7 @@ def view(ctx, recipe_id, template):
|
||||
logger.error(e)
|
||||
raise e
|
||||
|
||||
|
||||
@recipe.command()
|
||||
@click.option('--name', '-n', 'name')
|
||||
@click.option('-t', 'template')
|
||||
@ -407,6 +409,8 @@ def edit(recipe_id, name, template):
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
raise e
|
||||
|
||||
|
||||
@recipe.command()
|
||||
@click.argument('recipe_id', required=True)
|
||||
@click.option('-t', 'template')
|
||||
|
Loading…
Reference in New Issue
Block a user