Skip to content
Permalink
Browse files

Added more reserved words, fixed detection of duplicate capability names

  • Loading branch information
simoncadman committed Oct 5, 2013
1 parent 530fa4c commit e4543e78e26532726cb4be758d64256fa7109920
Showing with 18 additions and 12 deletions.
  1. +1 −1 backend.py
  2. +1 −1 deleteaccount.py
  3. +2 −2 dynamicppd.py
  4. +1 −1 listcloudprinters.py
  5. +9 −3 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 = "20131005 192654"
CCPVersion = "20131005 212032"
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 = "20131005 192654"
CCPVersion = "20131005 212032"
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 = "20131005 192654"
CCPVersion = "20131005 212032"
print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion
sys.exit(0)

@@ -137,7 +137,7 @@ def showUsage():

for capability in foundprinter['fulldetails']['capabilities']:
originCapabilityName = None
internalcapabilityName = printer.getInternalName(capability, 'capability', addedCapabilities)
internalcapabilityName = printer.getInternalName(capability, 'capability', None, addedCapabilities)
addedCapabilities.append(internalcapabilityName)

if 'displayName' in capability and len(capability['displayName']) > 0:
@@ -21,7 +21,7 @@

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

@@ -30,7 +30,8 @@ class Printer:
'Filter', 'Finishing', 'Font', 'Group', 'HWMargins', 'InputSlot', 'Installable',
'LocAttribute', 'ManualCopies', 'Manufacturer', 'MaxSize', 'MediaSize', 'MediaType',
'MinSize', 'ModelName', 'ModelNumber', 'Option', 'PCFileName', 'SimpleColorProfile',
'Throughput', 'UIConstraints', 'VariablePaperSize', 'Version', 'Color'
'Throughput', 'UIConstraints', 'VariablePaperSize', 'Version', 'Color', 'Background',
'Stamp', 'DestinationColorProfile'
]

def __init__( self, requestors ):
@@ -66,7 +67,7 @@ def getPrinters(self, fulldetails = False):
return allprinters

def sanitizeText(self, text):
return text.replace(':','_').replace(';','_').replace(' ','_').encode('utf8', 'ignore')
return text.replace('/','-').replace(':','_').replace(';','_').replace(' ','_').encode('utf8', 'ignore')

def printerNameToUri( self, account, printer ) :
"""Generates a URI for the Cloud Print Printer
@@ -454,10 +455,15 @@ def getInternalName ( self, details, internalType, capabilityName = None, existi
if returnValue not in existingList:
return returnValue

origReturnValue = returnValue

if "GCP_" + origReturnValue not in existingList:
return "GCP_" + origReturnValue

# max 100 rotations, prevent infinite loop
for i in range(1,100):
if returnValue in existingList:
returnValue += '_' + str(i)
returnValue = "GCP_" + str(i) + "_" + origReturnValue

# TODO: need to error if limit hit, or run out of chars allowed etc

@@ -19,7 +19,7 @@

if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
CCPVersion = "20131005 192654"
CCPVersion = "20131005 212032"
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 = "20131005 192654"
CCPVersion = "20131005 212032"
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 = "20131005 192654"
CCPVersion = "20131005 212032"
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 = "20131005 192654"
CCPVersion = "20131005 212032"
print "CUPS Cloud Print Upgrade Script Version " + CCPVersion
sys.exit(0)

0 comments on commit e4543e7

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