def __init__(self, name): self.ip = utils.getProperty(name, "ip") self.key = utils.getProperty(name, "rsaKey") self.username = utils.getProperty(name, "username") self.password = utils.decryptPassword(name) self.client = None self.options = utils.loadOptions(name)
def _printStartMenu(interfaces): print "\n", print "********************************\n" * 2 print "Welcome to the COL Production Control Panel!\n" print "********************************\n" * 2 # list out devices choices = {} for i, interface in enumerate(interfaces): id = i + 1 choices[id] = interface print str(id) + ".\t" + choices[id] print str(i + 2) + ".\tExit\n" while True: try: choice = int(raw_input("Choose an interface: ")) except ValueError: continue if choice < 0 or choice > (len(interfaces) + 1): continue if choice == (len(interfaces) + 1): exit() break # list out functions available to that device (use filter to only show options _ON) options = utils.loadOptions(choices[choice]).keys() if options == []: print "No options available!" exit() enabled = {} for j, option in enumerate(options): id = j + 1 enabled[id] = option print str(id) + ".\t" + enabled[id] print str(j + 2) + ".\tExit\n" while True: try: choice = int(raw_input("Choose an function: ")) except ValueError: continue if choice < 0 or choice > (len(interfaces) + 1): continue if choice == (len(enabled) + 1): exit() break
def __init__(self, name): self.ip = utils.getProperty(name, "ip") self.options = utils.loadOptions(name)