diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-02 21:46:15 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-02 21:46:15 +0100 |
commit | 7a503302fbe6fcc23af94de2fe313298c3a6d95c (patch) | |
tree | 724a8581008d3d78fed0be965161e330eb4b1064 /systemCheck.py | |
parent | closes #226, #227 (diff) | |
download | pyload-7a503302fbe6fcc23af94de2fe313298c3a6d95c.tar.xz |
removed django => now using bottle, new builtin threaded ssl server
Dont forget to install jinja and beaker !
Diffstat (limited to 'systemCheck.py')
-rw-r--r-- | systemCheck.py | 116 |
1 files changed, 36 insertions, 80 deletions
diff --git a/systemCheck.py b/systemCheck.py index 85c37873d..667a1a53c 100644 --- a/systemCheck.py +++ b/systemCheck.py @@ -1,62 +1,50 @@ import os -from os.path import dirname -from os.path import exists -from os.path import join import subprocess import sys -from module import InitHomeDir +#from module import InitHomeDir + +#very ugly prints, but at least it works with python 3 def main(): - print "##### System Information #####" - print "" - print "Platform:", sys.platform - print "Operating System:", os.name - print "Python:", sys.version.replace("\n", "") - print "" + print("##### System Information #####\n") + print("Platform:", sys.platform) + print("Operating System:", os.name) + print("Python:", sys.version.replace("\n", "")+ "\n") try: import pycurl - print "pycurl:", pycurl.version + print("pycurl:", pycurl.version) except: - print "pycurl:", "missing" + print("pycurl:", "missing") try: import Crypto - print "py-crypto:", Crypto.__version__ + print("py-crypto:", Crypto.__version__) except: - print "py-crypto:", "missing" + print("py-crypto:", "missing") try: import OpenSSL - print "OpenSSL:", OpenSSL.version.__version__ + print("OpenSSL:", OpenSSL.version.__version__) except: - print "OpenSSL:", "missing" + print("OpenSSL:", "missing") try: import Image - print "image libary:", Image.VERSION - except: - print "image libary:", "missing" - - try: - import django - print "django:", django.get_version() + print("image libary:", Image.VERSION) except: - print "django:", "missing" + print("image libary:", "missing") try: import PyQt4.QtCore - print "pyqt:", PyQt4.QtCore.PYQT_VERSION_STR + print("pyqt:", PyQt4.QtCore.PYQT_VERSION_STR) except: - print "pyqt:", "missing" + print("pyqt:", "missing") - print "" - print "" - print "##### System Status #####" - print "" - print "## pyLoadCore ##" + print("\n\n##### System Status #####") + print("\n## pyLoadCore ##") core_err = [] core_info = [] @@ -95,23 +83,19 @@ def main(): core_info.append("Install OpenSSL if you want to create a secure connection to the core.") if core_err: - print "The system check has detected some errors:" - print "" + print("The system check has detected some errors:\n") for err in core_err: - print err + print(err) else: - print "No Problems detected, pyLoadCore should work fine." + print("No Problems detected, pyLoadCore should work fine.") if core_info: - print "" - print "Possible improvements for pyload:" - print "" + print("\nPossible improvements for pyload:\n") for line in core_info: - print line + print(line) - print "" - print "## pyLoadGui ##" + print("\n## pyLoadGui ##") gui_err = [] @@ -121,66 +105,38 @@ def main(): gui_err.append("GUI won't work without pyqt4 !!") if gui_err: - print "The system check has detected some errors:" - print "" + print("The system check has detected some errors:\n") for err in gui_err: - print err + print(err) else: - print "No Problems detected, pyLoadGui should work fine." + print("No Problems detected, pyLoadGui should work fine.") - print "" - print "## Webinterface ##" + + print("\n## Webinterface ##") web_err = [] web_info = [] try: - import django - - if django.VERSION < (1, 1): - web_err.append("Your django version is to old, please upgrade to django 1.1") - elif django.VERSION > (1, 3): - web_err.append("Your django version is to new, please use django 1.2") - - except: - web_err.append("Webinterface won't work without django !!") - - if not exists("pyload.db"): - web_err.append("You dont have created database yet.") - web_err.append("Please run: python %s syncdb" % join(dirname(__file__), "module", "web", "manage.py")) - - try: import flup except: web_info.append("Install Flup to use FastCGI or optional webservers.") - try: - p = subprocess.call(["lighttpd", "-v"], stdout=pipe, stderr=pipe) - except: - web_info.append("Install lighttpd as optional webserver.") - - try: - p = subprocess.call(["nginx", "-v"], stdout=pipe, stderr=pipe) - except: - web_info.append("Install nginx as optional webserver.") if web_err: - print "The system check has detected some errors:" - print "" + print("The system check has detected some errors:\n") for err in web_err: - print err + print(err) else: - print "No Problems detected, Webinterface should work fine." + print("No Problems detected, Webinterface should work fine.") if web_info: - print "" - print "Possible improvements for webinterface:" - print "" + print("\nPossible improvements for webinterface:\n") for line in web_info: - print line + print(line) if __name__ == "__main__": main() - raw_input("Press Enter to Exit.") + input("Press Enter to Exit.") |