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
83f69770
Commit
83f69770
authored
Jul 10, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to define the same shift and breaks for all operators using all keyword
parent
55c02195
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
dream/plugins/Batches/BatchesOperatorBreaks.py
dream/plugins/Batches/BatchesOperatorBreaks.py
+19
-2
No files found.
dream/plugins/Batches/BatchesOperatorBreaks.py
View file @
83f69770
from
dream.plugins
import
plugin
from
dream.plugins.TimeSupport
import
TimeSupportMixin
import
datetime
from
copy
import
copy
class
BatchesOperatorBreaks
(
plugin
.
InputPreparationPlugin
,
TimeSupportMixin
):
""" Output the schedule of operators in an Excel file to be downloaded
...
...
@@ -18,6 +19,20 @@ class BatchesOperatorBreaks(plugin.InputPreparationPlugin, TimeSupportMixin):
self
.
initializeTimeSupport
(
data
)
breakData
=
data
[
'input'
][
'operator_shift_spreadsheet'
]
PBData
=
copy
(
data
[
'input'
].
get
(
'operator_skill_spreadsheet'
,
None
))
# create a string with all operator ids ids separated by commas
allString
=
''
for
row
in
PBData
:
if
row
[
0
]:
allString
+=
row
[
0
]
allString
+=
','
# if in operator shift there is ALL in a cell then give the all string
for
element
in
breakData
:
if
element
[
1
]
in
[
'ALL'
,
'All'
,
'all'
]:
element
[
1
]
=
allString
for
row
in
breakData
:
if
row
[
0
]
in
[
'Date'
,
''
,
None
]:
continue
...
...
@@ -26,6 +41,8 @@ class BatchesOperatorBreaks(plugin.InputPreparationPlugin, TimeSupportMixin):
# if element has spaces in beginning or in end remove them
operators
=
self
.
stripStringsOfList
(
operators
)
# remove empty strings
operators
=
filter
(
bool
,
operators
)
i
=
4
while
row
[
i
]
not
in
[
''
,
None
]:
...
...
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