Example #1
0
    def conf_basic(self):
        print ""
        print _("## Basic Setup ##")

        print ""
        print _("The following logindata is valid for CLI, GUI and webinterface.")

        from module.database import DatabaseBackend

        db = DatabaseBackend(None)
        db.setup()
        username = self.ask(_("Username"), "User")
        password = self.ask("", "", password=True)
        db.addUser(username, password)
        db.shutdown()

        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["remote"]["activated"] = self.ask(_("Enable remote access"), self.yes, bool=True)

        print ""
        langs = self.config.getMetaData("general", "language")
        self.config["general"]["language"] = self.ask(_("Language"), "en", langs.type.split(";"))

        self.config["general"]["download_folder"] = self.ask(_("Downloadfolder"), "Downloads")
        self.config["download"]["max_downloads"] = self.ask(_("Max parallel downloads"), "3")
        #print _("You should disable checksum proofing, if you have low hardware requirements.")
        #self.config["general"]["checksum"] = self.ask(_("Proof checksum?"), "y", bool=True)

        reconnect = self.ask(_("Use Reconnect?"), self.no, bool=True)
        self.config["reconnect"]["activated"] = reconnect
        if reconnect:
            self.config["reconnect"]["method"] = self.ask(_("Reconnect script location"), "./reconnect.sh")
Example #2
0
    def conf_basic(self):
        print _("## Basic Setup ##")

        print
        print _("The following logindata is valid for CLI and webinterface.")
        
        from module.database import DatabaseBackend

        db = DatabaseBackend(None)
        db.setup()
        print _("NOTE: Consider a password of 10 or more symbols if you expect to access from outside your local network (ex. internet).")
        print
        username = self.ask(_("Username"), "User")
        password = self.ask("", "", password=True)
        db.addUser(username, password)
        db.shutdown()

        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["remote"]["activated"] = self.ask(_("Enable remote access"), self.no, bool=True)

        print
        langs = self.config.getMetaData("general", "language")
        self.config["general"]["language"] = self.ask(_("Choose pyLoad language"), "en", langs["type"].split(";"))

        print
        self.config["general"]["download_folder"] = self.ask(_("Download folder"), "Downloads")
        print
        self.config["download"]["max_downloads"] = self.ask(_("Max parallel downloads"), "3")
        print
        reconnect = self.ask(_("Use Reconnect?"), self.no, bool=True)
        self.config["reconnect"]["activated"] = reconnect
        if reconnect:
            self.config["reconnect"]["method"] = self.ask(_("Reconnect script location"), "./reconnect.sh")
Example #3
0
    def set_user(self):
        gettext.setpaths(
            [os.path.join(os.sep, "usr", "share", "pyload", "locale"), None])
        translation = gettext.translation(
            "setup",
            os.path.join(self.path, "locale"),
            languages=[self.config["general"]["language"], "en"],
            fallback=True,
        )
        install_translation(translation)

        from module.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 = 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()
Example #4
0
    def set_user(self):
        gettext.setpaths(
            [join(os.sep, "usr", "share", "pyload", "locale"), None])
        translation = gettext.translation(
            "setup",
            join(self.path, "locale"),
            languages=[self.config["general"]["language"], "en"],
            fallback=True)
        translation.install(True)

        from module.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.getAllUserData()
                    noaction = False
                    for user in users.itervalues():
                        print user.name
                    print "-----"
                    print ""
                elif action == "3":
                    print ""
                    username = self.ask(_("Username"), "")
                    if username:
                        db.removeUser(username)
                        noaction = False
                elif action == "4":
                    db.syncSave()
                    break
        finally:
            if not noaction:
                db.shutdown()
Example #5
0
    def set_user(self):
        gettext.setpaths([join(os.sep, "usr", "share", "pyload", "locale"), None])
        translation = gettext.translation("setup", join(self.path, "locale"),
            languages=[self.config["general"]["language"], "en"], fallback=True)
        translation.install(True)

        from module.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.getAllUserData()
                    noaction = False
                    for user in users.itervalues():
                        print user.name
                    print "-----"
                    print ""
                elif action == "3":
                    print ""
                    username = self.ask(_("Username"), "")
                    if username:
                        db.removeUser(username)
                        noaction = False
                elif action == "4":
                    db.syncSave()
                    break
        finally:
            if not noaction:
                db.shutdown()
Example #6
0
    def conf_basic(self):
        print _("## Basic Setup ##")

        print
        print _("The following logindata is valid for CLI and webinterface.")

        from module.database import DatabaseBackend

        db = DatabaseBackend(None)
        db.setup()
        print _(
            "NOTE: Consider a password of 10 or more symbols if you expect to access from outside your local network (ex. internet)."
        )
        print
        username = self.ask(_("Username"), "User")
        password = self.ask("", "", password=True)
        db.addUser(username, password)
        db.shutdown()

        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["remote"]["activated"] = self.ask(
            _("Enable remote access"), self.no, bool=True)

        print
        langs = self.config.getMetaData("general", "language")
        self.config["general"]["language"] = self.ask(
            _("Choose pyLoad language"), "en", langs["type"].split(";"))

        print
        self.config["general"]["download_folder"] = self.ask(
            _("Download folder"), "Downloads")
        print
        self.config["download"]["max_downloads"] = self.ask(
            _("Max parallel downloads"), "3")
        print
        reconnect = self.ask(_("Use Reconnect?"), self.no, bool=True)
        self.config["reconnect"]["activated"] = reconnect
        if reconnect:
            self.config["reconnect"]["method"] = self.ask(
                _("Reconnect script location"), "./reconnect.sh")