Skip to content
Permalink
Browse files

Ignore duplicate orientation

  • Loading branch information
simoncadman committed Oct 6, 2013
1 parent cc5e139 commit fc27412b56fc8dfe8e36ca6692cbce7414626c6c
Showing with 27 additions and 12 deletions.
  1. +1 −1 backend.py
  2. +1 −1 deleteaccount.py
  3. +1 −1 dynamicppd.py
  4. +1 −1 listcloudprinters.py
  5. +19 −4 printer.py
  6. +1 −1 reportissues.py
  7. +1 −1 setupcloudprint.py
  8. +1 −1 submitjob.py
  9. +1 −1 upgrade.py
@@ -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)

@@ -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)

@@ -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)

@@ -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)

@@ -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' }
@@ -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")
@@ -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)

@@ -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)

@@ -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)

@@ -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)

0 comments on commit fc27412

Please sign in to comment.
You can’t perform that action at this time.