Permalink
Browse files

Use parameter name instead of displayname, if displayname isnt set

  • Loading branch information...
simoncadman committed May 18, 2013
1 parent aa9cc83 commit 093fdfb6c530218171b79df4701af3b61dea9c13
Showing with 9 additions and 4 deletions.
  1. +9 −4 dynamicppd.py
View
@@ -103,16 +103,21 @@ def showUsage():
#print foundprinter['fulldetails']
if 'capabilities' in foundprinter['fulldetails']:
for capability in foundprinter['fulldetails']['capabilities']:
+ capabilityName = None
+ if 'displayName' in capability:
+ capabilityName = capability['displayName']
+ else:
+ capabilityName = capability['name']
if capability['type'] == 'Feature':
- ppddetails += '*OpenUI *GCP_' + capability['name'].replace(':','_') + '/' + capability['displayName'] +': PickOne' + "\n"
+ ppddetails += '*OpenUI *GCP_' + capability['name'].replace(':','_') + '/' + capabilityName +': PickOne' + "\n"
for option in capability['options']:
if 'default' in option and option['default'] == True:
ppddetails += '*DefaultGCP_' + capability['name'].replace(':','_') + ': ' + option['name'] + "\n"
- ppddetails += '*GCP_' + capability['name'].replace(':','_') + ' ' + option['displayName'] + ':' + option['name'] + '' + "\n"
- ppddetails += '*CloseUI: *GCP_' + capability['displayName'] + "\n"
+ ppddetails += '*GCP_' + capability['name'].replace(':','_') + ' ' + capabilityName + ':' + option['name'] + '' + "\n"
+ ppddetails += '*CloseUI: *GCP_' + capabilityName + "\n"
elif capability['type'] == 'ParameterDef':
pass
- #print option['displayName']
+ #print capabilityName
#print capability['psf:MinValue'], capability['psf:MaxValue']
ppddetails += """*DefaultFont: Courier

0 comments on commit 093fdfb

Please sign in to comment.