Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Extract correct parameter id , fix name of capability options back

  • Loading branch information
simoncadman committed Jun 8, 2013
1 parent 4ceaf80 commit ded86d1a415ae4d81a698ef2e9ea02d2222c96cb
Showing with 8 additions and 7 deletions.
  1. +4 −4 dynamicppd.py
  2. +4 −3 printer.py
@@ -105,19 +105,19 @@ def showUsage():
capabilityName = None
internalcapabilityName = hashlib.sha256(capability['name'].replace(':','_')).hexdigest()[:7]
if 'displayName' in capability:
capabilityName = capability['displayName'].replace(':','_').replace('&','').replace(' ','_')
capabilityName = capability['displayName'].replace(':','_').replace(' ','_')
elif 'psk:DisplayName' in capability:
capabilityName = capability['psk:DisplayName'].replace(':','_').replace('&','').replace(' ','_')
capabilityName = capability['psk:DisplayName'].replace(':','_').replace(' ','_')
else:
capabilityName = capability['name'].replace(':','_')
if capability['type'] == 'Feature':
ppddetails += '*OpenUI *GCP_' + internalcapabilityName + '/' + capabilityName +': PickOne' + "\n"
for option in capability['options']:
optionName = None
if 'displayName' in option:
optionName = option['displayName'].replace(':','_').replace('&','').replace(' ','_')
optionName = option['displayName'].replace(':','_').replace(' ','_')
elif 'psk:DisplayName' in option:
optionName = option['psk:DisplayName'].replace(':','_').replace('&','').replace(' ','_')
optionName = option['psk:DisplayName'].replace(':','_').replace(' ','_')
else:
optionName = option['name'].replace(':','_')
internalOptionName = hashlib.sha256(option['name'].replace(':','_')).hexdigest()[:7]
@@ -288,11 +288,12 @@ def getCapabilities ( self, gcpid, cupsprintername ) :
details = self.getPrinterDetails( gcpid )
fulldetails = details['printers'][0]
for capability in fulldetails['capabilities']:
gcpname = capability['name']
break
if hashname == hashlib.sha256(capability['name'].replace(':','_')).hexdigest()[:7]:
gcpname = capability['name']
break

# hardcoded to feature type temporarily
capabilities['capabilities'].append( { 'type' : 'Feature', 'name' : gcpname, 'options' : [ { 'name' : attr.value } ] } )
capabilities['capabilities'].append( { 'type' : 'Feature', 'name' : gcpname, 'options' : [ { 'name' : attr.value.replace('_',' ') } ] } )
return capabilities

def submitJob(self, printerid, jobtype, jobfile, jobname, printername ):

0 comments on commit ded86d1

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