Commit 4b9d8def authored by Maxime Bombar's avatar Maxime Bombar

OTL in Staples and punching options

parent 633a365b
......@@ -40,13 +40,30 @@ def get_path(filefield):
"""
return(LOCATION + filefield)
def HP_name(name):
def HP_name_staples(name):
"""
"""
if 'Top' in name:
return '1Staple%sAngled' % (name.replace('Top', ''))
else:
return '2Staples%s' % name
return '2Staples%s' % name.split('Sided')[0]
def HP_name_punch(name):
"""
"""
if name == "TwoLeftSidedHoles":
return "2HolePunchLeft"
if name == "TwoRightSidedHoles":
return "2HolePunchRight"
if name == "TwoTopHoles":
return "2HolePunchTop"
if name == "TwoBottomHoles":
return "2HolePunchBottom"
if name == "FourLeftSidedHoles":
return "4HolePunchLeft"
if name == "FourRightSidedHoles":
return "4HolePunchRight"
def send(filepath, filename, number, pages, settings, debug):
......@@ -97,14 +114,14 @@ def send(filepath, filename, number, pages, settings, debug):
cmd += ['-o', 'HPStaplerOptions=FoldStitch']
elif not (stapling == 'None'):
cmd += ['-o', 'HPStaplerOptions=%s' % HP_name(stapling)]
cmd += ['-o', 'HPStaplerOptions=%s' % HP_name_staples(stapling)]
perforation = settings['perforation']
# Holes
if not booklet:
if not(perforation == 'None'):
cmd += ['-o', 'HPStaplerOptions=%s' % perforation]
cmd += ['-o', 'HPPunchingOptions=%s' % HP_name_punch(perforation)]
# Format booklet
......
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