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
7d26dd8a
Commit
7d26dd8a
authored
May 21, 2018
by
Flavio TARSETTI
Browse files
[common] patch local list for plotterparameter
parent
62596fc4
Pipeline
#20385
passed with stages
in 30 minutes and 40 seconds
Changes
1
Pipelines
3
Show whitespace changes
Inline
Side-by-side
beat/cmdline/common.py
View file @
7d26dd8a
...
...
@@ -50,6 +50,7 @@ from beat.core import algorithm
from
beat.core
import
toolchain
from
beat.core
import
experiment
from
beat.backend.python
import
utils
TYPE_GLOB
=
{
'dataformat'
:
os
.
path
.
join
(
'*'
,
'*'
,
'*.json'
),
...
...
@@ -393,6 +394,13 @@ def make_up_local_list(prefix, type, requirements):
'''
root
=
os
.
path
.
join
(
prefix
,
TYPE_PLURAL
[
type
])
if
type
in
NOSTORAGE
:
try
:
root
=
os
.
path
.
join
(
prefix
,
TYPE_NOSTORAGE
[
type
])
except
:
logger
.
error
(
"Selected type is not valid: %s"
%
type
)
return
1
l
=
glob
.
glob
(
os
.
path
.
join
(
root
,
TYPE_GLOB
[
type
]))
candidates
=
[
os
.
path
.
splitext
(
os
.
path
.
relpath
(
o
,
root
))[
0
]
for
o
in
l
]
...
...
@@ -449,6 +457,13 @@ def display_local_list(prefix, type):
for
name
in
names
:
logger
.
info
(
"%s"
,
name
)
try
:
contents
=
None
if
type
in
NOSTORAGE
:
name_path
=
os
.
path
.
join
(
prefix
,
TYPE_NOSTORAGE
[
type
],
name
)
data_json
=
utils
.
File
(
name_path
+
'.json'
)
with
open
(
data_json
.
path
,
'rt'
)
as
f
:
contents
=
simplejson
.
load
(
f
,
object_pairs_hook
=
collections
.
OrderedDict
)
else
:
storage
=
TYPE_STORAGE
[
type
](
prefix
,
name
)
contents
=
simplejson
.
loads
(
storage
.
json
.
load
(),
object_pairs_hook
=
collections
.
OrderedDict
)
if
'description'
in
contents
:
...
...
@@ -778,7 +793,6 @@ def pull(webapi, prefix, type, names, fields, force, indentation):
status
+=
1
#error
continue
from
beat.backend.python
import
utils
if
'data'
in
fields
:
name_path
=
os
.
path
.
join
(
prefix
,
TYPE_NOSTORAGE
[
type
],
name
)
data_json
=
utils
.
File
(
name_path
+
'.json'
)
...
...
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