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):
|
class GrocyGroup(click.Group):
|
||||||
def parse_args(self, ctx, args):
|
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:
|
if is_subcommand:
|
||||||
ctx.forward(self.commands[args[0]], args[1:])
|
ctx.forward(self.commands[args[0]], args[1:])
|
||||||
super(GrocyGroup, self).parse_args(ctx, args)
|
super(GrocyGroup, self).parse_args(ctx, args)
|
||||||
@ -230,6 +230,7 @@ def add(template):
|
|||||||
logger.error(e)
|
logger.error(e)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
@main.group()
|
@main.group()
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def recipe(ctx):
|
def recipe(ctx):
|
||||||
@ -275,6 +276,7 @@ def view(ctx, recipe_id, template):
|
|||||||
logger.error(e)
|
logger.error(e)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
@recipe.command()
|
@recipe.command()
|
||||||
@click.option('--name', '-n', 'name')
|
@click.option('--name', '-n', 'name')
|
||||||
@click.option('-t', 'template')
|
@click.option('-t', 'template')
|
||||||
@ -407,6 +409,8 @@ def edit(recipe_id, name, template):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
@recipe.command()
|
@recipe.command()
|
||||||
@click.argument('recipe_id', required=True)
|
@click.argument('recipe_id', required=True)
|
||||||
@click.option('-t', 'template')
|
@click.option('-t', 'template')
|
||||||
|
Loading…
Reference in New Issue
Block a user