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
1545f30b
Commit
1545f30b
authored
Feb 19, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new plugin for JopShop instance. Reads operators skills from a spreadsheet
parent
8e27c774
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
dream/plugins/ReadJSSkills.py
dream/plugins/ReadJSSkills.py
+41
-0
No files found.
dream/plugins/ReadJSSkills.py
0 → 100644
View file @
1545f30b
from
copy
import
copy
import
json
import
time
import
random
import
operator
from
datetime
import
datetime
import
copy
import
routeQuery
from
datetime
import
datetime
from
dream.plugins
import
plugin
class
ReadJSSkills
(
plugin
.
InputPreparationPlugin
):
""" Input preparation
reads the operators and their skills from the spreadsheet and adds them to the model
"""
def
preprocess
(
self
,
data
):
""" Read the operator and the tasks they can perform and adds them to them to the graph.
"""
PBData
=
data
[
'input'
].
get
(
'operator_skill_spreadsheet'
,
None
)
node
=
data
[
'graph'
][
'node'
]
if
PBData
:
PBData
.
pop
(
0
)
# pop the column names
for
PBitem
in
PBData
:
PBId
=
PBitem
[
0
]
PBId
=
PBId
.
split
(
"-"
)[
0
]
# in case there is no id, do not process the element
if
not
PBId
:
continue
skills
=
PBitem
[
1
].
replace
(
" "
,
""
).
split
(
';'
)
node
[
PBId
]
=
{
"_class"
:
"Dream.Operator"
,
"capacity"
:
1
,
"name"
:
PBId
,
"skills"
:
skills
,
"ouputSchedule"
:
1
}
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