def conf_basic(self): print _("## Basic Setup ##") print print _("The following logindata is valid for CLI and webinterface.") from pyload.Database import DatabaseBackend db = DatabaseBackend(None) db.setup() print _( "NOTE: Consider a password of 10 or more symbols if you expect to access to your local network from outside (ex. internet)." ) print username = self.ask(_("Username"), "User") password = self.ask("", "", password=True) db.addUser(username, password) db.shutdown() print print print _( "External clients (GUI, CLI or other) need remote access to work over the network." ) print _( "However, if you only want to use the webinterface you may disable it to save ram." ) self.config.set( "remote", "activated", self.ask(_("Enable remote access"), self.no, bool=True)) print langs = sorted( self.config.getMetaData("general", "language")['type'].split(";")) self.config.set( "general", "language", self.ask(_("Choose system language"), self.lang, langs)) print self.config.set("general", "download_folder", self.ask(_("Download folder"), "Downloads")) print self.config.set("download", "max_downloads", self.ask(_("Max parallel downloads"), "3")) print reconnect = self.ask(_("Use Reconnect?"), self.no, bool=True) self.config.set("reconnect", "activated", reconnect) if reconnect: self.config.set( "reconnect", "method", self.ask(_("Reconnect script location"), "./reconnect.sh"))
def set_user(self): load_translation("setup", self.config.get("general", "language")) from pyload.Database import DatabaseBackend db = DatabaseBackend(None) db.setup() noaction = True try: while True: print _("Select action") print _("1 - Create/Edit user") print _("2 - List users") print _("3 - Remove user") print _("4 - Quit") action = raw_input("1/2/3/4: ") if not action in ("1", "2", "3", "4"): continue elif action == "1": print username = self.ask(_("Username"), "User") password = self.ask("", "", password=True) db.addUser(username, password) noaction = False elif action == "2": print print _("Users") print "-----" users = db.listUsers() noaction = False for user in users: print user print "-----" print elif action == "3": print username = self.ask(_("Username"), "") if username: db.removeUser(username) noaction = False elif action == "4": break finally: if not noaction: db.shutdown()
def conf_basic(self): print _("## Basic Setup ##") print print _("The following logindata is valid for CLI and webinterface.") from pyload.Database import DatabaseBackend db = DatabaseBackend(None) db.setup() print _("NOTE: Consider a password of 10 or more symbols if you expect to access to your local network from outside (ex. internet).") print username = self.ask(_("Username"), "User") password = self.ask("", "", password=True) db.addUser(username, password) db.shutdown() print print print _("External clients (GUI, CLI or other) need remote access to work over the network.") print _("However, if you only want to use the webinterface you may disable it to save ram.") self.config.set("remote", "activated", self.ask(_("Enable remote access"), self.no, bool=True)) print langs = sorted(self.config.getMetaData("general", "language")['type'].split(";")) self.config.set("general", "language", self.ask(_("Choose system language"), self.lang, langs)) print self.config.set("general", "download_folder", self.ask(_("Download folder"), "Downloads")) print self.config.set("download", "max_downloads", self.ask(_("Max parallel downloads"), "3")) print reconnect = self.ask(_("Use Reconnect?"), self.no, bool=True) self.config.set("reconnect", "activated", reconnect) if reconnect: self.config.set("reconnect", "method", self.ask(_("Reconnect script location"), "./reconnect.sh"))