diff options
-rw-r--r-- | module/setup.py | 13 | ||||
-rw-r--r-- | module/web/settings.py | 3 | ||||
-rwxr-xr-x | pyLoadCore.py | 28 |
3 files changed, 25 insertions, 19 deletions
diff --git a/module/setup.py b/module/setup.py index 79bb51e22..93cde8a0d 100644 --- a/module/setup.py +++ b/module/setup.py @@ -201,12 +201,12 @@ class Setup(): print "" print _("The following logindata are only valid for CLI and GUI, but NOT for webinterface.") - self.config["remote"]["username"] = self.ask(_("Username"), "User") - self.config["remote"]["password"] = self.ask("", "", password=True) + self.config.username = self.ask(_("Username"), "User") + self.config.password = self.ask("", "", password=True) print "" self.config["general"]["language"] = self.ask(_("Language"), "en", ["en", "de", "fr", "nl", "pl"]) - self.config["general"]["download_Folder"] = self.ask(_("Downloadfolder"), "Downloads") + self.config["general"]["download_folder"] = self.ask(_("Downloadfolder"), "Downloads") self.config["general"]["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) @@ -221,7 +221,7 @@ class Setup(): print "" print _("## Webinterface Setup ##") - db_path = join(self.path, "module", "web", "pyload.db") + db_path = "pyload.db" is_db = isfile(db_path) db_setup = True @@ -280,8 +280,9 @@ class Setup(): translation.install(unicode=(True if sys.getfilesystemencoding().startswith("utf") else False)) print _("Setting new username and password") print "" - self.config["remote"]["username"] = self.ask(_("Username"), "User") - self.config["remote"]["password"] = self.ask("", "", password=True) + self.config.username = self.ask(_("Username"), "User") + self.config.password = self.ask("", "", password=True) + self.config.save() def print_dep(self, name, value): """Print Status of dependency""" diff --git a/module/web/settings.py b/module/web/settings.py index 7380541e6..760ace9f4 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -63,7 +63,8 @@ ADMINS = ( MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = os.path.join(PROJECT_DIR, 'pyload.db') # Or path to database file if using sqlite3.
+#DATABASE_NAME = os.path.join(PROJECT_DIR, 'pyload.db') # Or path to database file if using sqlite3.
+DATABASE_NAME = 'pyload.db' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
diff --git a/pyLoadCore.py b/pyLoadCore.py index ab69e3d9f..02975ad2f 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -85,13 +85,13 @@ class Core(object): exit() elif option in ("-c", "--clear"): try: - #@TODO rewrite - remove(join(self.configdir, "module", "links.pkl")) + remove("files.db") print "Removed Linklist" except: print "No Linklist found" elif option in ("-a", "--add"): - self.arg_links.append(argument) + #self.arg_links.append(argument) + #@TODO print "Added %s" % argument elif option in ("-h", "--help"): self.print_help() @@ -99,19 +99,15 @@ class Core(object): elif option in ("-d", "--debug"): self.doDebug = True elif option in ("-u", "--user"): - #@TODO rewrite from module.setup import Setup - self.xmlconfig = XMLConfigParser(self.make_path(self.configdir, "core.xml"), defaultFile=join(self.path, "module", "config", "core_default.xml")) - self.config = self.xmlconfig.getConfig() - s = Setup(self.path, self.config) + self.config = ConfigParser() + s = Setup(pypath, self.config) s.set_user() exit() elif option in ("-s", "--setup"): from module.setup import Setup - #@TODO rewrite - self.xmlconfig = XMLConfigParser(self.make_path(self.configdir, "core.xml"), defaultFile=join(self.path, "module", "config", "core_default.xml")) - self.config = self.xmlconfig.getConfig() - s = Setup(self.path, self.config) + self.config = ConfigParser() + s = Setup(pypath, self.config) s.start() exit() except GetoptError: @@ -155,7 +151,15 @@ class Core(object): try: signal.signal(signal.SIGQUIT, self.quit) except: pass - + if not exists("pyload.conf"): + from module.setup import Setup + print "This is your first start, running configuration assistent now." + self.config = ConfigParser() + s = Setup(pypath, self.config) + s.start() + exit() + + self.config = ConfigParser() translation = gettext.translation("pyLoad", self.path("locale"), languages=["en", self.config['general']['language']]) |