Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
7fa6792d
Commit
7fa6792d
authored
Jan 16, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pre-process plugin to validate the entityData of NonStarvingEntity
parent
11372d90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
dream/plugins/ReadEntryData.py
dream/plugins/ReadEntryData.py
+30
-0
No files found.
dream/plugins/ReadEntryData.py
0 → 100644
View file @
7fa6792d
from
copy
import
copy
import
json
import
time
import
random
import
operator
from
datetime
import
datetime
from
dream.plugins
import
plugin
class
ReadEntryData
(
plugin
.
InputPreparationPlugin
):
""" Input preparation
reads the entries if any, and updates the keys of the entityData dict
"""
def
preprocess
(
self
,
data
):
""" read the entries data and change the class key of the entityData dict to _class
"""
node
=
data
[
'graph'
][
'node'
]
for
stationKey
,
stationData
in
node
.
iteritems
():
entityData
=
stationData
.
pop
(
"entityData"
,
None
)
if
entityData
:
entityClass
=
entityData
.
pop
(
"class"
,
None
)
if
entityClass
:
entityData
[
"_class"
]
=
entityClass
else
:
entityData
[
"_class"
]
=
"Dream.Part"
stationData
[
"entityData"
]
=
entityData
return
data
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