Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Berk Onat
python-common
Commits
755b8a39
Commit
755b8a39
authored
Sep 06, 2016
by
Lauri Himanen
Browse files
Added additional warning to LocalBackend about adding the same data multiple times to.
parent
1e6f1e44
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/python/nomadcore/local_backend.py
View file @
755b8a39
...
...
@@ -202,11 +202,12 @@ class LocalBackend(object):
"""
pass
def
addMatchTelemetry
(
self
,
match_telemetry
,
gIndex
=
-
1
):
def
addMatchTelemetry
(
self
,
match_telemetry
,
gIndex
=
-
1
):
""" should be called for outputting match telemetry data:
input data, together with capture info """
pass
#===============================================================================
class
Results
(
object
):
"""A wrapper object for the collection of results gathered by a parser.
...
...
@@ -241,12 +242,9 @@ class Results(object):
open_sections
=
sectionmanager
.
openSections
result
=
[]
for
section
in
open_sections
.
values
():
data_list
=
section
[
metaname
]
if
data_list
is
not
None
:
if
len
(
data_list
)
==
1
:
result
.
append
(
data_list
[
0
])
else
:
result
.
append
(
data_list
)
data
=
section
[
metaname
]
if
data
is
not
None
:
result
.
append
(
data
)
if
len
(
result
)
==
1
:
return
result
[
0
]
elif
len
(
result
)
==
0
:
...
...
@@ -349,10 +347,10 @@ class Section(object):
there aren't any. You can search values and subsections.
"""
res
=
self
.
simpleValues
.
get
(
metaName
,
None
)
if
res
:
if
res
is
not
None
:
return
res
res
=
self
.
arrayValues
.
get
(
metaName
,
None
)
if
res
:
if
res
is
not
None
:
return
res
res
=
self
.
subSectionValues
.
get
(
metaName
,
None
)
return
res
...
...
@@ -361,9 +359,9 @@ class Section(object):
if
self
.
backend
.
store
:
vals
=
self
.
simpleValues
.
get
(
metaInfo
.
name
,
None
)
if
vals
is
None
:
self
.
simpleValues
[
metaInfo
.
name
]
=
[
value
]
self
.
simpleValues
[
metaInfo
.
name
]
=
value
else
:
vals
.
append
(
valu
e
)
raise
Exception
(
"Trying to add values multiple times for metaname {} in section {}. "
.
format
(
metaInfo
.
name
,
self
.
nam
e
)
)
def
setArrayValues
(
self
,
metaInfo
,
values
,
offset
=
None
):
if
self
.
backend
.
store
:
...
...
@@ -381,9 +379,9 @@ class Section(object):
if
self
.
backend
.
store
:
vals
=
self
.
arrayValues
.
get
(
metaInfo
.
name
,
None
)
if
vals
is
None
:
self
.
arrayValues
[
metaInfo
.
name
]
=
[
values
]
self
.
arrayValues
[
metaInfo
.
name
]
=
values
else
:
vals
.
append
(
values
)
raise
Exception
(
"Trying to add values multiple times for metaname {} in section {}. "
.
format
(
metaInfo
.
name
,
self
.
name
)
)
def
addSubsection
(
self
,
metaInfo
,
section
):
vals
=
self
.
subSectionValues
.
get
(
metaInfo
.
name
,
None
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment