Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
beat.editor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
beat
beat.editor
Commits
3c17198f
Commit
3c17198f
authored
Oct 10, 2019
by
Samuel GAIST
Committed by
Samuel GAIST
Nov 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[scripts][editor_cli] Use new beat/beat.cmdline> environment command to update information
parent
3457169f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
beat/editor/scripts/editor_cli.py
beat/editor/scripts/editor_cli.py
+13
-13
conda/meta.yaml
conda/meta.yaml
+1
-1
No files found.
beat/editor/scripts/editor_cli.py
View file @
3c17198f
...
...
@@ -39,11 +39,10 @@ from click_plugins import with_plugins
from
PyQt5.QtWidgets
import
QApplication
from
PyQt5.QtCore
import
QCoreApplication
from
beat.core.dock
import
Host
from
beat.cmdline.click_helper
import
AliasedGroup
from
beat.cmdline.decorators
import
raise_on_error
from
beat.cmdline.decorators
import
verbosity_option
from
beat.cmdline
import
environments
from
..utils
import
setup_logger
from
..utils
import
check_prefix_folders
...
...
@@ -64,19 +63,13 @@ global logger
logger
=
None
def
dump_environments
(
environments_file_path
):
logger
.
info
(
"Generating environments information"
)
Host
(
images_cache
=
environments_file_path
,
raise_on_errors
=
False
)
logger
.
info
(
"Done"
)
def
setup_environment_cache
(
ctx
,
param
,
value
):
"""Click option callback to setup environment cache"""
if
not
value
:
environments
=
ctx
.
meta
[
"environments"
]
if
not
os
.
path
.
exists
(
environments
):
dump_environments
(
environments
)
environments
_file_path
=
ctx
.
meta
[
"environments"
]
if
not
os
.
path
.
exists
(
environments
_file_path
):
ctx
.
invoke
(
environments
.
list
,
type_
=
"all"
,
output
=
environments_file_path
)
def
check_prefix
(
prefix_path
):
...
...
@@ -194,15 +187,22 @@ Example:
@
editor
.
command
(
epilog
=
ENV_REFRESH_EPILOG
)
@
click
.
option
(
"--type"
,
"-t"
,
"type_"
,
type
=
click
.
Choice
([
"docker"
,
"remote"
,
"all"
],
case_sensitive
=
False
),
default
=
"all"
,
)
@
click
.
pass_context
@
raise_on_error
def
refresh_env
(
ctx
):
def
refresh_env
(
ctx
,
type_
):
"""Update environments cache"""
environments_file_path
=
ctx
.
meta
[
"environments"
]
if
os
.
path
.
exists
(
environments_file_path
):
os
.
remove
(
environments_file_path
)
dump_environments
(
environments_file_path
)
ctx
.
invoke
(
environments
.
list
,
type_
=
type_
,
output
=
environments_file_path
)
@
editor
.
group
(
cls
=
AliasedGroup
)
...
...
conda/meta.yaml
View file @
3c17198f
...
...
@@ -30,7 +30,7 @@ requirements:
-
click
-
click-plugins
-
docopt
-
beat.cmdline >=1.5.
0
b0
-
beat.cmdline >=1.5.
1
b0
test
:
requires
:
...
...
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