Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.cmdline
Commits
bf4ac376
Commit
bf4ac376
authored
May 03, 2019
by
Samuel GAIST
Browse files
[commands] Factored all fork commands to use common function
parent
5ab3e5f5
Changes
9
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/algorithms.py
View file @
bf4ac376
...
...
@@ -340,6 +340,7 @@ algorithms.command(name="check")(commands.command("check"))
algorithms
.
command
(
name
=
"status"
)(
commands
.
command
(
"status"
))
algorithms
.
command
(
name
=
"create"
)(
commands
.
command
(
"create"
))
algorithms
.
command
(
name
=
"version"
)(
commands
.
command
(
"version"
))
algorithms
.
command
(
name
=
"fork"
)(
commands
.
command
(
"fork"
))
@
algorithms
.
command
()
...
...
@@ -411,20 +412,6 @@ def diff(ctx, name):
)
@
algorithms
.
command
()
@
click
.
argument
(
"src"
,
nargs
=
1
)
@
click
.
argument
(
"dst"
,
nargs
=
1
)
@
click
.
pass_context
@
raise_on_error
def
fork
(
ctx
,
src
,
dst
):
"""Forks a local algorithm
Example:
$ beat algorithms fork xxx yyy
"""
return
common
.
fork
(
ctx
.
meta
[
"config"
].
path
,
"algorithm"
,
src
,
dst
)
@
algorithms
.
command
()
@
click
.
argument
(
"name"
,
nargs
=-
1
)
@
click
.
option
(
...
...
beat/cmdline/commands.py
View file @
bf4ac376
...
...
@@ -163,6 +163,20 @@ def version_impl(ctx, name):
return
common
.
new_version
(
ctx
.
meta
[
"config"
].
path
,
ctx
.
meta
[
"asset_type"
],
name
)
@
click
.
argument
(
"src"
,
nargs
=
1
)
@
click
.
argument
(
"dst"
,
nargs
=
1
)
@
click
.
pass_context
@
raise_on_error
def
fork_impl
(
ctx
,
src
,
dst
):
"""Forks a local asset
Example:
$ beat <asset_type> fork xxx yyy
"""
return
common
.
fork
(
ctx
.
meta
[
"config"
].
path
,
ctx
.
meta
[
"asset_type"
],
src
,
dst
)
CMD_TABLE
=
{
"list"
:
list_impl
,
"path"
:
path_impl
,
...
...
@@ -171,6 +185,7 @@ CMD_TABLE = {
"status"
:
status_impl
,
"create"
:
create_impl
,
"version"
:
version_impl
,
"fork"
:
fork_impl
,
}
...
...
beat/cmdline/dataformats.py
View file @
bf4ac376
...
...
@@ -147,6 +147,7 @@ dataformats.command(name="check")(commands.command("check"))
dataformats
.
command
(
name
=
"status"
)(
commands
.
command
(
"status"
))
dataformats
.
command
(
name
=
"create"
)(
commands
.
command
(
"create"
))
dataformats
.
command
(
name
=
"version"
)(
commands
.
command
(
"version"
))
dataformats
.
command
(
name
=
"fork"
)(
commands
.
command
(
"fork"
))
@
dataformats
.
command
()
...
...
@@ -221,20 +222,6 @@ def diff(ctx, name):
)
@
dataformats
.
command
()
@
click
.
argument
(
"src"
,
nargs
=
1
)
@
click
.
argument
(
"dst"
,
nargs
=
1
)
@
click
.
pass_context
@
raise_on_error
def
fork
(
ctx
,
src
,
dst
):
"""Forks a local dataformat
Example:
$ beat dataformats fork xxx yyy
"""
return
common
.
fork
(
ctx
.
meta
[
"config"
].
path
,
"dataformat"
,
src
,
dst
)
@
dataformats
.
command
()
@
click
.
argument
(
"name"
,
nargs
=-
1
)
@
click
.
option
(
...
...
beat/cmdline/experiments.py
View file @
bf4ac376
...
...
@@ -695,6 +695,7 @@ experiments.command(name="path")(commands.command("path"))
experiments
.
command
(
name
=
"edit"
)(
commands
.
command
(
"edit"
))
experiments
.
command
(
name
=
"check"
)(
commands
.
command
(
"check"
))
experiments
.
command
(
name
=
"status"
)(
commands
.
command
(
"status"
))
experiments
.
command
(
name
=
"fork"
)(
commands
.
command
(
"fork"
))
@
experiments
.
command
()
...
...
@@ -811,20 +812,6 @@ def diff(ctx, name):
)
@
experiments
.
command
()
@
click
.
argument
(
"src"
,
nargs
=
1
)
@
click
.
argument
(
"dst"
,
nargs
=
1
)
@
click
.
pass_context
@
raise_on_error
def
fork
(
ctx
,
src
,
dst
):
"""Forks a local experiment.
$ beat experiments fork xxx yyy
"""
config
=
ctx
.
meta
.
get
(
"config"
)
return
common
.
fork
(
config
.
path
,
"experiment"
,
src
,
dst
)
@
experiments
.
command
()
@
click
.
argument
(
"names"
,
nargs
=-
1
)
@
click
.
option
(
...
...
beat/cmdline/libraries.py
View file @
bf4ac376
...
...
@@ -180,6 +180,7 @@ libraries.command(name="check")(commands.command("check"))
libraries
.
command
(
name
=
"status"
)(
commands
.
command
(
"status"
))
libraries
.
command
(
name
=
"create"
)(
commands
.
command
(
"create"
))
libraries
.
command
(
name
=
"version"
)(
commands
.
command
(
"version"
))
libraries
.
command
(
name
=
"fork"
)(
commands
.
command
(
"fork"
))
@
libraries
.
command
()
...
...
@@ -251,20 +252,6 @@ def diff(ctx, name):
)
@
libraries
.
command
()
@
click
.
argument
(
"src"
,
nargs
=
1
)
@
click
.
argument
(
"dst"
,
nargs
=
1
)
@
click
.
pass_context
@
raise_on_error
def
fork
(
ctx
,
src
,
dst
):
"""Forks a local library
Example:
$ beat libraries fork xxx yyy
"""
return
common
.
fork
(
ctx
.
meta
[
"config"
].
path
,
"library"
,
src
,
dst
)
@
libraries
.
command
()
@
click
.
argument
(
"names"
,
nargs
=
1
)
@
click
.
option
(
...
...
beat/cmdline/plotterparameters.py
View file @
bf4ac376
...
...
@@ -108,6 +108,7 @@ plotterparameters.command(name="check")(commands.command("check"))
plotterparameters
.
command
(
name
=
"status"
)(
commands
.
command
(
"status"
))
plotterparameters
.
command
(
name
=
"create"
)(
commands
.
command
(
"create"
))
plotterparameters
.
command
(
name
=
"version"
)(
commands
.
command
(
"version"
))
plotterparameters
.
command
(
name
=
"fork"
)(
commands
.
command
(
"fork"
))
@
plotterparameters
.
command
()
...
...
@@ -127,19 +128,6 @@ def pull(ctx, names, force):
return
pull_impl
(
webapi
,
ctx
.
meta
[
"config"
].
path
,
name
,
force
,
0
,
{})
@
plotterparameters
.
command
()
@
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.
$ beat plotterparameters fork xxx yyy
"""
return
common
.
fork
(
ctx
.
meta
[
"config"
].
path
,
"plotterparameter"
,
src
,
dst
)
@
plotterparameters
.
command
()
@
click
.
argument
(
"names"
,
nargs
=-
1
)
@
click
.
pass_context
...
...
beat/cmdline/plotters.py
View file @
bf4ac376
...
...
@@ -324,6 +324,7 @@ plotters.command(name="check")(commands.command("check"))
plotters
.
command
(
name
=
"status"
)(
commands
.
command
(
"status"
))
plotters
.
command
(
name
=
"create"
)(
commands
.
command
(
"create"
))
plotters
.
command
(
name
=
"version"
)(
commands
.
command
(
"version"
))
plotters
.
command
(
name
=
"fork"
)(
commands
.
command
(
"fork"
))
@
plotters
.
command
()
...
...
@@ -381,19 +382,6 @@ def plot(
)
@
plotters
.
command
()
@
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.
$ beat plotters fork xxx yyy
"""
return
common
.
fork
(
ctx
.
meta
[
"config"
].
path
,
"plotter"
,
src
,
dst
)
@
plotters
.
command
()
@
click
.
argument
(
"names"
,
nargs
=-
1
)
@
click
.
pass_context
...
...
beat/cmdline/protocoltemplates.py
View file @
bf4ac376
...
...
@@ -63,3 +63,4 @@ protocoltemplates.command(name="check")(commands.command("check"))
protocoltemplates
.
command
(
name
=
"status"
)(
commands
.
command
(
"status"
))
protocoltemplates
.
command
(
name
=
"create"
)(
commands
.
command
(
"create"
))
protocoltemplates
.
command
(
name
=
"version"
)(
commands
.
command
(
"version"
))
protocoltemplates
.
command
(
name
=
"fork"
)(
commands
.
command
(
"fork"
))
beat/cmdline/toolchains.py
View file @
bf4ac376
...
...
@@ -58,6 +58,7 @@ toolchains.command(name="check")(commands.command("check"))
toolchains
.
command
(
name
=
"status"
)(
commands
.
command
(
"status"
))
toolchains
.
command
(
name
=
"create"
)(
commands
.
command
(
"create"
))
toolchains
.
command
(
name
=
"version"
)(
commands
.
command
(
"version"
))
toolchains
.
command
(
name
=
"fork"
)(
commands
.
command
(
"fork"
))
@
toolchains
.
command
()
...
...
@@ -137,19 +138,6 @@ def diff(ctx, name):
)
@
toolchains
.
command
()
@
click
.
argument
(
"src"
,
nargs
=
1
)
@
click
.
argument
(
"dst"
,
nargs
=
1
)
@
click
.
pass_context
@
raise_on_error
def
fork
(
ctx
,
src
,
dst
):
"""Forks a local toolchain.
$ beat toolchains fork xxx yyy
"""
return
common
.
fork
(
ctx
.
meta
[
"config"
].
path
,
"toolchain"
,
src
,
dst
)
@
toolchains
.
command
()
@
click
.
argument
(
"names"
,
nargs
=-
1
)
@
click
.
option
(
"--remote"
,
help
=
"Only acts on the remote copy."
,
is_flag
=
True
)
...
...
Write
Preview
Supports
Markdown
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