def main(args): while True: try: pwd = getpass.getpass("Confluence password for %s: "\ % getpass.getuser()) rc = cli.login(getpass.getuser(), pwd, page.SPACE_KEY) break except cli.AuthFailure: pass if args.page: cid = page.extractPageId(args.page) if not cid: return False else: while True: try: cid = page.askForPageId() break except fields.AbortPage: print print "-ERROR- Page aborted." except KeyboardInterrupt: return False return add_efuse(cid=cid, efuse=args.efuse, force=args.force, dryrun=args.dryrun)
def main(args): try: while True: try: pwd = getpass.getpass("Confluence password for %s: "\ % getpass.getuser()) rc = cli.login(getpass.getuser(), pwd, page.SPACE_KEY) break except cli.AuthFailure: pass if args.page: cid = page.extractPageId(args.page) if not cid: return False else: while True: cid = page.askForPageId() break return updateProperty(cid) except KeyboardInterrupt: print return False
def main(args): print """ Type control-D or control-C at a prompt to terminate. While making a page type a period to abort the page. """ while True: try: pwd = getpass.getpass("Confluence password for %s: "\ % getpass.getuser()) rc = cli.login(getpass.getuser(), pwd, page.SPACE_KEY) break except cli.AuthFailure: pass try: if args.page: cid = page.extractPageId(args.page) if not cid: return False return init_page(cid=cid, devtype=args.board, tag=args.tag, status=args.status, site=args.loc, dryrun=args.dryrun) # If the page wasn't specified on the command line, # just keep asking for new pages. else: while True: cid = page.askForPageId() init_page(cid=cid, devtype=args.board, tag=args.tag, status=args.status, site=args.loc, dryrun=args.dryrun) except fields.AbortPage: print print "-ERROR- Page aborted." except KeyboardInterrupt: print return False
sys.exit(1) macs = [] if args.burn: macs = cmb_efuse.burn_macs() cmb_efuse.dump_macs() else: print "BURN option not selected" if args.dump: macs = cmb_efuse.dump_macs() if args.hwdb and macs: print "Updating Hardware Database with MACs" while True: try: pwd = getpass.getpass("Confluence password for %s: " % getpass.getuser()) rc = cli.login(getpass.getuser(), pwd, page.SPACE_KEY) break except cli.AuthFailure: pass cid = page.askForPageId() maclist = [m.addr for m in macs] try: update_macs.add_macs(cid, idx=0, macs=maclist) except ValueError, e: print "Couldn't update HWDB:", e