Commit 4f3c311d authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[plotterparameters] pre-commit cleanup

parent 125d911f
......@@ -79,13 +79,18 @@ def pull_impl(webapi, prefix, names, force, indentation, format_cache):
"""
# download required plotterparameter
status, names = common.pull(webapi, prefix, 'plotterparameter', names,
['data', 'short_description', 'plotter'], force,
indentation)
status, names = common.pull(
webapi,
prefix,
"plotterparameter",
names,
["data", "short_description", "plotter"],
force,
indentation,
)
return status
@click.group(cls=AliasedGroup)
@click.pass_context
def plotterparameters(ctx):
......@@ -93,133 +98,127 @@ def plotterparameters(ctx):
pass
@plotterparameters.command()
@click.option('--remote', help='Only acts on the remote copy of the list.',
is_flag=True)
@click.option(
"--remote", help="Only acts on the remote copy of the list.", is_flag=True
)
@click.pass_context
@raise_on_error
def list(ctx, remote):
'''Lists all the plotterparameters available on the platform.
"""Lists all the plotterparameters available on the platform.
To list all existing plotterparameters on your local prefix:
$ beat plotterparameters list
'''
"""
if remote:
with common.make_webapi(ctx.meta['config']) as webapi:
return common.display_remote_list(webapi, 'plotterparameter')
with common.make_webapi(ctx.meta["config"]) as webapi:
return common.display_remote_list(webapi, "plotterparameter")
else:
return common.display_local_list(ctx.meta['config'].path, 'plotterparameter')
return common.display_local_list(ctx.meta["config"].path, "plotterparameter")
@plotterparameters.command()
@click.argument('names', nargs=-1)
@click.argument("names", nargs=-1)
@click.pass_context
@raise_on_error
def path(ctx, names):
'''Displays local path of plotterparameter files
"""Displays local path of plotterparameter files
Example:
$ beat plotterparameters path xxx
'''
return common.display_local_path(ctx.meta['config'].path, 'plotterparameter', names)
"""
return common.display_local_path(ctx.meta["config"].path, "plotterparameter", names)
@plotterparameters.command()
@click.argument('name', nargs=1)
@click.argument("name", nargs=1)
@click.pass_context
@raise_on_error
def edit(ctx, name):
'''Edit local plotterparameter file
"""Edit local plotterparameter file
Example:
$ beat plotterparameter edit xxx
'''
return common.edit_local_file(ctx.meta['config'].path,
ctx.meta['config'].editor, 'plotterparameter',
name)
"""
return common.edit_local_file(
ctx.meta["config"].path, ctx.meta["config"].editor, "plotterparameter", name
)
@plotterparameters.command()
@click.argument('names', nargs=-1)
@click.argument("names", nargs=-1)
@click.pass_context
@raise_on_error
def check(ctx, names):
'''Checks a local plotter for validity.
"""Checks a local plotter for validity.
$ beat plotterparameters check xxx
'''
return common.check(ctx.meta['config'].path, 'plotterparameter', names)
"""
return common.check(ctx.meta["config"].path, "plotterparameter", names)
@plotterparameters.command()
@click.argument('names', nargs=-1)
@click.option('--force', help='Force',
is_flag=True)
@click.argument("names", nargs=-1)
@click.option("--force", help="Force", is_flag=True)
@click.pass_context
@raise_on_error
def pull(ctx, names, force):
'''Downloads the specified plotterparameters from the server.
"""Downloads the specified plotterparameters from the server.
$ beat plotterparameters pull xxx.
'''
with common.make_webapi(ctx.meta['config']) as webapi:
name = common.make_up_remote_list(webapi, 'plotterparameter', names)
"""
with common.make_webapi(ctx.meta["config"]) as webapi:
name = common.make_up_remote_list(webapi, "plotterparameter", names)
if name is None:
return 1 #error
return pull_impl(webapi, ctx.meta['config'].path, name, force, 0, {})
return 1 # error
return pull_impl(webapi, ctx.meta["config"].path, name, force, 0, {})
@plotterparameters.command()
@click.argument('names', nargs=-1)
@click.argument("names", nargs=-1)
@click.pass_context
@raise_on_error
def create(ctx, names):
'''Creates a new local plotter.
"""Creates a new local plotter.
$ beat plotterparameters create xxx
'''
return common.create(ctx.meta['config'].path, 'plotterparameter', names)
"""
return common.create(ctx.meta["config"].path, "plotterparameter", names)
@plotterparameters.command()
@click.argument('name', nargs=1)
@click.argument("name", nargs=1)
@click.pass_context
@raise_on_error
def version(ctx, name):
'''Creates a new version of an existing plotter.
"""Creates a new version of an existing plotter.
$ beat plotterparameters version xxx
'''
return common.new_version(ctx.meta['config'].path, 'plotterparameter', name)
"""
return common.new_version(ctx.meta["config"].path, "plotterparameter", name)
@plotterparameters.command()
@click.argument('src', nargs=1)
@click.argument('dst', nargs=1)
@click.argument("src", nargs=1)
@click.argument("dst", nargs=1)
@click.pass_context
@raise_on_error
def fork(ctx, src, dst):
'''Forks a local plotter.
"""Forks a local plotter.
$ beat plotterparameters fork xxx yyy
'''
return common.fork(ctx.meta['config'].path, 'plotterparameter', src, dst)
"""
return common.fork(ctx.meta["config"].path, "plotterparameter", src, dst)
@plotterparameters.command()
@click.argument('names', nargs=-1)
@click.argument("names", nargs=-1)
@click.pass_context
@raise_on_error
def rm(ctx, names):
'''Deletes a local plotter.
"""Deletes a local plotter.
$ beat plotterparameters rm xxx
'''
return common.delete_local(ctx.meta['config'].path, 'plotterparameter',
names)
"""
return common.delete_local(ctx.meta["config"].path, "plotterparameter", names)
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