Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.cmdline
Commits
852e120a
Commit
852e120a
authored
Jul 06, 2018
by
Samuel GAIST
Browse files
[plotterparameters] Use raise_on_error decorator for commands
parent
d2c611a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/plotterparameters.py
View file @
852e120a
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment