Permalink
Browse files

Post name of capability instead of internal hash, should fix issues w…

…ith capabilities failing to work correctly
  • Loading branch information...
simoncadman committed Aug 17, 2013
1 parent cccbb38 commit 37c14bf51bccead241dcf2b2fcdf70ef7341f887
Showing with 6 additions and 1 deletion.
  1. +6 −1 printer.py
View
@@ -290,13 +290,18 @@ def getCapabilities ( self, gcpid, cupsprintername ) :
# find item name from hashes
details = self.getPrinterDetails( gcpid )
fulldetails = details['printers'][0]
+ gcpoption = ""
for capability in fulldetails['capabilities']:
if hashname == hashlib.sha256(self.sanitizeText(capability['name'])).hexdigest()[:7]:
gcpname = capability['name']
+ for option in capability['options']:
+ if attr.value == hashlib.sha256(self.sanitizeText(option['name'])).hexdigest()[:7]:
+ gcpoption = option['name']
+ break
break
# hardcoded to feature type temporarily
- capabilities['capabilities'].append( { 'type' : 'Feature', 'name' : gcpname, 'options' : [ { 'name' : attr.value.replace('_',' ') } ] } )
+ capabilities['capabilities'].append( { 'type' : 'Feature', 'name' : gcpname, 'options' : [ { 'name' : gcpoption } ] } )
return capabilities
def submitJob(self, printerid, jobtype, jobfile, jobname, printername ):

0 comments on commit 37c14bf

Please sign in to comment.