Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Commit

Permalink
Ignore duplicate orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncadman committed Oct 6, 2013
1 parent cc5e139 commit fc27412
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
CCPVersion = "20131006 154219"
CCPVersion = "20131006 165226"
print "CUPS Cloud Print CUPS Backend Version " + CCPVersion
sys.exit(0)

Expand Down
2 changes: 1 addition & 1 deletion deleteaccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
CCPVersion = "20131006 154219"
CCPVersion = "20131006 165226"
print "CUPS Cloud Print Delete Account Script Version " + CCPVersion
sys.exit(0)

Expand Down
2 changes: 1 addition & 1 deletion dynamicppd.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
CCPVersion = "20131006 154219"
CCPVersion = "20131006 165226"
print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion
sys.exit(0)

Expand Down
2 changes: 1 addition & 1 deletion listcloudprinters.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
CCPVersion = "20131006 154219"
CCPVersion = "20131006 165226"
print "CUPS Cloud Print Printer Lister Version " + CCPVersion
sys.exit(0)

Expand Down
23 changes: 19 additions & 4 deletions printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,19 @@ def getCapabilities ( self, gcpid, cupsprintername, overrideoptionsstring ) :
cupsprinters = connection.getPrinters()
capabilities = { "capabilities" : [] }
overridecapabilities = {}
ignorecapabilities = [ 'Orientation' ]
for optiontext in overrideoptions:
if '=' in optiontext :
optionparts = optiontext.split('=')
option = optionparts[0]
if option in ignorecapabilities:
continue

value = optionparts[1]
overridecapabilities[option] = value
# portrait
if optiontext == 'portrait':
overridecapabilities['Orientation'] = 'Portrait'

# landscape
if optiontext == 'landscape':
if optiontext == 'landscape' or optiontext == 'nolandscape':
overridecapabilities['Orientation'] = 'Landscape'

overrideDefaultDefaults = { 'Duplex' : 'None' }
Expand Down Expand Up @@ -363,6 +364,20 @@ def submitJob(self, printerid, jobtype, jobfile, jobname, printername, options="
Returns:
boolean: True = submitted, False = errors.
"""
rotate = 0

for optiontext in options.split(' '):

# landscape
if optiontext == 'landscape':
# landscape
rotate = 90

# nolandscape - already rotates
if optiontext == 'nolandscape':
# rotate back
rotate = -90

if jobtype == 'pdf':
if not os.path.exists(jobfile):
print("ERROR: PDF doesnt exist")
Expand Down
2 changes: 1 addition & 1 deletion reportissues.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
CCPVersion = "20131006 154219"
CCPVersion = "20131006 165226"
print "CUPS Cloud Print Issue Reporting Script Version " + CCPVersion
sys.exit(0)

Expand Down
2 changes: 1 addition & 1 deletion setupcloudprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
CCPVersion = "20131006 154219"
CCPVersion = "20131006 165226"
print "CUPS Cloud Print Setup Script Version " + CCPVersion
sys.exit(0)

Expand Down
2 changes: 1 addition & 1 deletion submitjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
CCPVersion = "20131006 154219"
CCPVersion = "20131006 165226"
print "CUPS Cloud Print Submit Job Version " + CCPVersion
sys.exit(0)

Expand Down
2 changes: 1 addition & 1 deletion upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
CCPVersion = "20131006 154219"
CCPVersion = "20131006 165226"
print "CUPS Cloud Print Upgrade Script Version " + CCPVersion
sys.exit(0)

Expand Down

0 comments on commit fc27412

Please sign in to comment.