Skip to content

Commit

Permalink
Adding collate option to the generate_pdf.py script.
Browse files Browse the repository at this point in the history
  • Loading branch information
philsc committed May 5, 2013
1 parent d4eb3e5 commit 4905c34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion generate_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
help='File where the field data is stored. ' +
'This must be a python script with an array called "data" ' +
'of Field entries.')
parser.add_argument(
'--collate',
choices=['on', 'off'],
default='on',
help='Turns collatating on or off. Default is on.')

args = parser.parse_args()

Expand All @@ -44,5 +49,5 @@
# If everything went well, proceed to generate the PDF
st = Scantron(args.output, spacing=0.3*inch)
st.set_box_sizes(box_size=0.2*inch, box_spacing=0.3*inch)
st.populate(data, matches=args.num_matches)
st.populate(data, matches=args.num_matches, collate=args.collate)
st.save()
2 changes: 1 addition & 1 deletion scantron.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def add_sheet(self, data, match=1, position=1):
self.draw_boolean(field.label)


def populate(self, data, matches=1):
def populate(self, data, matches=1, collate='on'):
for match in range(1, matches + 1):
for position in range(1, 7):
self.add_sheet(data, match, position)
Expand Down

0 comments on commit 4905c34

Please sign in to comment.