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
ad4c9436
Commit
ad4c9436
authored
Feb 25, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new plugin ReadJSSkillsToStations is added. Turns skills to the corresponding stations
parent
4d8023e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
dream/plugins/ReadJSSkillsToStations.py
dream/plugins/ReadJSSkillsToStations.py
+42
-0
No files found.
dream/plugins/ReadJSSkillsToStations.py
0 → 100644
View file @
ad4c9436
from
copy
import
copy
import
json
import
time
import
random
import
operator
from
datetime
import
datetime
import
copy
from
datetime
import
datetime
from
dream.plugins
import
plugin
from
dream.plugins
import
UpdateStationList
class
ReadJSSkillsToStations
(
UpdateStationList
.
UpdateStationList
):
""" Input preparation
reads the operators and turns the technology-skills to the corresponding station-skills
"""
def
preprocess
(
self
,
data
):
""" turns the technology-skills to the corresponding station-skills
"""
self
.
data
=
data
nodes
=
data
[
'graph'
][
'node'
]
# if there are nodes defined
if
nodes
:
# scan the nodes available
for
ID
,
node_data
in
nodes
.
iteritems
():
# if the node class is operator (if it has skillDict)
skillDict
=
node_data
.
get
(
"skillDict"
,
{})
if
skillDict
:
for
operation
,
technologyList
in
skillDict
.
iteritems
():
stationList
=
[]
for
technology
in
technologyList
:
tech
=
technology
.
split
(
"-"
)[
0
]
for
station
in
data
[
"graph"
][
"node"
]:
if
station
.
startswith
(
self
.
getStationInitials
(
tech
))
\
and
data
[
"graph"
][
"node"
][
station
][
"_class"
]
in
self
.
STATION_CLASS_SET
:
stationList
.
append
(
station
)
skillDict
[
operation
]
=
stationList
nodes
[
ID
][
"skillDict"
]
=
skillDict
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