print "You currently have these accounts configured: " for requestor in requestors: print requestor.getAccount() add_account = len(requestors) == 0 else: add_account = True if not add_account: if not options.interactive: break answer = raw_input("Add more accounts (Y/N)? ") if answer.lower().startswith("y"): add_account = True else: break if add_account: Auth.AddAccount(None, userid=options.user) for requestor in requestors: addedCount = 0 cupsprinters = cupsHelper.getPrinters() prefix = "" printer_manager = PrinterManager(requestor) printers = printer_manager.getPrinters() if printers is None: print "Sorry, no printers were found on your Google Cloud Print account." continue if options.add_all.lower() == "y": answer = "y" else: answer = raw_input(
# remove old config file print "Deleting old configuration file: " + Auth.config os.remove(Auth.config) while True: requestors, storage = Auth.SetupAuth(True) print "You currently have these accounts configured: " for requestor in requestors: print requestor.getAccount() if unattended: break answer = raw_input("Add more accounts (Y/N)? ") if not answer.lower().startswith("y"): break else: Auth.AddAccount(None) connection = cups.Connection() for requestor in requestors: addedCount = 0 cupsprinters = connection.getPrinters() prefix = "" printer_manager = PrinterManager(requestor) printers = printer_manager.getPrinters() if printers is None: print "Sorry, no printers were found on your Google Cloud Print account." continue if unattended: answer = "y"
data = json.loads(content) except: # remove old config file print("Deleting old configuration file: " + Auth.config) os.remove(Auth.config) while True: requestors, storage = Auth.SetupAuth(True) print "You currently have these accounts configured: " for requestor in requestors: print requestor.getAccount() answer = raw_input("Add more accounts (Y/N)? ") if not (answer.startswith("Y") or answer.startswith("y")): break else: Auth.AddAccount(storage) for requestor in requestors: addedCount = 0 connection = cups.Connection() cupsprinters = connection.getPrinters() prefix = "" printer = Printer(requestor) printers = printer.getPrinters() if printers == None: print( "Sorry, no printers were found on your Google Cloud Print account." ) continue answer = raw_input(