Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cfel_fmt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dataAnalysis
cfel_fmt
Commits
bec78125
Commit
bec78125
authored
8 years ago
by
Valerio Mariani
Browse files
Options
Downloads
Plain Diff
Merge branch 'testing'
parents
ca5834e1
4515ee42
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cfel_optarg.py
+6
-11
6 additions, 11 deletions
cfel_optarg.py
with
6 additions
and
11 deletions
cfel_optarg.py
+
6
−
11
View file @
bec78125
...
...
@@ -72,11 +72,6 @@ def parse_parameters(config):
monitor_params
[
sect
][
op
]
=
config
.
get
(
sect
,
op
)
if
monitor_params
[
sect
][
op
].
startswith
(
"'"
)
and
monitor_params
[
sect
][
op
].
endswith
(
"'"
):
monitor_params
[
sect
][
op
]
=
monitor_params
[
sect
][
op
][
1
:
-
1
]
try
:
monitor_params
[
sect
][
op
].
encode
(
'
ascii
'
)
except
UnicodeEncodeError
:
raise
RuntimeError
(
'
Error parsing parameters. Only ASCII characters are allowed in parameter
'
'
names and values.
'
)
continue
if
monitor_params
[
sect
][
op
].
startswith
(
'"'
)
and
monitor_params
[
sect
][
op
].
endswith
(
'"'
):
monitor_params
[
sect
][
op
]
=
monitor_params
[
sect
][
op
][
1
:
-
1
]
...
...
@@ -86,7 +81,7 @@ def parse_parameters(config):
monitor_params
[
sect
][
op
]
=
ast
.
literal_eval
(
config
.
get
(
sect
,
op
))
continue
except
(
SyntaxError
,
ValueError
):
raise
RuntimeError
(
'
Error parsing parameter {0} in section {1}. Make sure that the syntax is
'
raise
RuntimeError
(
'
Error parsing parameter {0} in section
[
{1}
]
. Make sure that the syntax is
'
'
correct: list elements must be separated by commas and dict entries must
'
'
contain the colon symbol. Strings must be quoted, even in lists and
'
'
dicts.
'
.
format
(
op
,
sect
))
...
...
@@ -95,7 +90,7 @@ def parse_parameters(config):
monitor_params
[
sect
][
op
]
=
ast
.
literal_eval
(
config
.
get
(
sect
,
op
))
continue
except
(
SyntaxError
,
ValueError
):
raise
RuntimeError
(
'
Error parsing parameter {0} in section {1}. Make sure that the syntax is
'
raise
RuntimeError
(
'
Error parsing parameter {0} in section
[
{1}
]
. Make sure that the syntax is
'
'
correct: list elements must be separated by commas and dict entries must
'
'
contain the colon symbol. Strings must be quoted, even in lists and
'
'
dicts.
'
.
format
(
op
,
sect
))
...
...
@@ -116,8 +111,8 @@ def parse_parameters(config):
monitor_params
[
sect
][
op
]
=
float
(
monitor_params
[
sect
][
op
])
continue
except
ValueError
:
raise
RuntimeError
(
'
Error parsing parameter
s. The parameter {0}/{1} parameter has an invalid type.
'
'
Allowed types are None, int, float, bool and str. S
tri
ng
s must
be
'
'
single-quoted.
'
.
format
(
sect
,
op
))
raise
RuntimeError
(
'
Error parsing parameter
{0} in section [{1}]. Make sure that the syntax is
'
'
correct: list elements must be separated by commas and dict en
tri
e
s must
'
'
contain the colon symbol. Strings must be quoted, even in lists and
'
'
dicts.
'
.
format
(
op
,
sect
))
return
monitor_params
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment