Commit 852e120a authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[plotterparameters] Use raise_on_error decorator for commands

parent d2c611a6
......@@ -26,16 +26,18 @@
###############################################################################
import click
import simplejson
import collections
from .dataformats import pull as dataformats_pull
from beat.cmdline.scripts.click_helper import AliasedGroup
import logging
logger = logging.getLogger(__name__)
from beat.cmdline.scripts.click_helper import AliasedGroup
from . import common
from .decorators import raise_on_error
logger = logging.getLogger(__name__)
def pull_impl(webapi, prefix, names, force, indentation, format_cache):
"""Copies plotterparameters from the server.
......@@ -90,6 +92,7 @@ def plotterparameters(ctx):
@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.
......@@ -107,6 +110,7 @@ def list(ctx, remote):
@plotterparameters.command()
@click.argument('names', nargs=-1)
@click.pass_context
@raise_on_error
def path(ctx, names):
'''Displays local path of plotterparameter files
......@@ -119,6 +123,7 @@ def path(ctx, names):
@plotterparameters.command()
@click.argument('name', nargs=1)
@click.pass_context
@raise_on_error
def edit(ctx, name):
'''Edit local plotterparameter file
......@@ -133,6 +138,7 @@ def edit(ctx, name):
@plotterparameters.command()
@click.argument('names', nargs=-1)
@click.pass_context
@raise_on_error
def check(ctx, names):
'''Checks a local plotter for validity.
......@@ -147,6 +153,7 @@ def check(ctx, names):
@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.
......@@ -163,6 +170,7 @@ def pull(ctx, names, force):
@plotterparameters.command()
@click.argument('names', nargs=-1)
@click.pass_context
@raise_on_error
def create(ctx, names):
'''Creates a new local plotter.
......@@ -175,6 +183,7 @@ def create(ctx, names):
@plotterparameters.command()
@click.argument('name', nargs=1)
@click.pass_context
@raise_on_error
def version(ctx, name):
'''Creates a new version of an existing plotter.
......@@ -187,6 +196,7 @@ def version(ctx, name):
@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.
......@@ -199,6 +209,7 @@ def fork(ctx, src, dst):
@plotterparameters.command()
@click.argument('names', nargs=-1)
@click.pass_context
@raise_on_error
def rm(ctx, names):
'''Deletes a local plotter.
......
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