Skip to content
Permalink
Browse files

Only ask once per account for prefix

  • Loading branch information
simoncadman committed Jun 23, 2013
1 parent 2c3413c commit 720c44ee6ffaebef4994105de61af7c367abc2d8
Showing with 7 additions and 7 deletions.
  1. +7 −7 setupcloudprint.py
@@ -64,7 +64,7 @@
i+=1
print str(i) + ") " + printeritem['displayName']
maxprinterid = i
answer = raw_input("Add printer (1-" + str(maxprinterid) + ", 0 to exit)? ")
answer = raw_input("Add printer (1-" + str(maxprinterid) + ", 0 to cancel)? ")
try:
answer = int(answer)
except ValueError:
@@ -93,6 +93,12 @@
print "\nPrinter " + str(answer) + " not found\n"
continue

prefixanswer = raw_input("Use a prefix for names of created printers (Y/N)? ")
if ( prefixanswer.startswith("Y") or prefixanswer.startswith("y") ):
prefix = raw_input("Prefix ( e.g. GCP- )? ")
if prefix == "":
print("Not using prefix")

for ccpprinter in printers:
uri = printer.printerNameToUri(ccpprinter['account'], ccpprinter['name'].encode('ascii', 'replace'))
found = False
@@ -101,12 +107,6 @@
found = True

if found == False:
prefixanswer = raw_input("Use a prefix for names of created printers (Y/N)? ")
if ( prefixanswer.startswith("Y") or prefixanswer.startswith("y") ):
prefix = raw_input("Prefix ( e.g. GCP- )? ")
if prefix == "":
print("Not using prefix")

printername = prefix + ccpprinter['name']

# check if printer name already exists

0 comments on commit 720c44e

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