Commit 5ac9990b authored by Georgios Dagkakis's avatar Georgios Dagkakis

allow all keyword in operators shift

parent 5476bd27
...@@ -19,6 +19,7 @@ class BatchesShift(ReadShiftFromSpreadsheet): ...@@ -19,6 +19,7 @@ class BatchesShift(ReadShiftFromSpreadsheet):
def preprocess(self, data): def preprocess(self, data):
nodes=data['graph']['node'] nodes=data['graph']['node']
machineshiftData=data['input'].get('machine_shift_spreadsheet', None) machineshiftData=data['input'].get('machine_shift_spreadsheet', None)
operatorshiftData=data['input'].get('operator_shift_spreadsheet', None)
# create a string with all station ids separated by commas # create a string with all station ids separated by commas
allString='' allString=''
...@@ -31,6 +32,18 @@ class BatchesShift(ReadShiftFromSpreadsheet): ...@@ -31,6 +32,18 @@ class BatchesShift(ReadShiftFromSpreadsheet):
if element[1] in ['ALL','All','all']: if element[1] in ['ALL','All','all']:
element[1]=allString element[1]=allString
# create a string with all operator ids separated by commas
allString=''
for node_id, node in nodes.iteritems():
if node['_class']=='Dream.Operator':
allString+=node_id
allString+=','
print allString
# if in machine shift there is a
for element in operatorshiftData:
if element[1] in ['ALL','All','all']:
element[1]=allString
# run the standard shift plugin # run the standard shift plugin
data=ReadShiftFromSpreadsheet.preprocess(self, data) data=ReadShiftFromSpreadsheet.preprocess(self, data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment