def run(self): """ The main routine """ m = msh(os.path.join(sys.path[0], 'config.cfg')) while True: m.check_for_new_commands() time.sleep(m.get_param_int('Main', 'INTERVAL_TO_CHECK_IN_SEC'))
def adduser(self): """ Simple prompt to add new users """ m = msh(os.path.join(sys.path[0], 'config.cfg')) username = raw_input('Enter user name: ') pw1 = getpass.getpass() pw2 = getpass.getpass("Confirm password: ") if pw1 == pw2: m.add_new_user(username, pw1) print 'User was succesfully added.' else: print 'Error: you provided different passwords'
def singlerun(self): m = msh(os.path.join(sys.path[0], 'config.cfg')) m.check_for_new_commands()