From d56dcab5d48c8c4ec05f200f92bd35a1f977cd4f Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 6 Jan 2010 17:38:53 +0100 Subject: cli fix, webinterface db check --- module/web/ServerThread.py | 11 +++++++++++ module/web/manage.py | 0 module/web/pyload_default.db | Bin 44032 -> 0 bytes 3 files changed, 11 insertions(+) mode change 100644 => 100755 module/web/manage.py delete mode 100644 module/web/pyload_default.db (limited to 'module/web') diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 069cabafe..8be3892b5 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -2,6 +2,7 @@ from __future__ import with_statement import threading from os.path import join +from os.path import exists from subprocess import Popen, PIPE, STDOUT from time import sleep from signal import SIGINT @@ -18,6 +19,16 @@ class WebServer(threading.Thread): host = self.pycore.config['webinterface']['host'] port = self.pycore.config['webinterface']['port'] command = ['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)] + + if not exists(join(self.pycore.path,"module","web","pyload.db")): + print "########## IMPORTANT ###########" + print "### Database for Webinterface doesnt exitst, it will not be available." + print "### Please run: python %s syncdb" % join(self.pycore.path,"module","web","manage.py") + print "### You have to add at least one User, to gain access to webinterface: python %s createsuperuser" % join(self.pycore.path,"module","web","manage.py") + print "### Dont forget to restart pyLoad if you are done." + print "################################" + raise Exception, "Database doesnt exists, please use syncdb" + self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) if os.name == 'posix': diff --git a/module/web/manage.py b/module/web/manage.py old mode 100644 new mode 100755 diff --git a/module/web/pyload_default.db b/module/web/pyload_default.db deleted file mode 100644 index cd39d0ca8..000000000 Binary files a/module/web/pyload_default.db and /dev/null differ -- cgit v1.2.3