summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-02-02 22:18:29 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2010-02-02 22:18:29 +0100
commit11fa2456d87d99571b94b0d895d6c06a2c40199f (patch)
treeb612118af4ed934c46d46500960b3ec16f2c09a0
parentcloses #70, thx kepheus (diff)
parentsystemCheck.py (diff)
downloadpyload-11fa2456d87d99571b94b0d895d6c06a2c40199f.tar.xz
merge
-rwxr-xr-xpyLoadCore.py2
-rw-r--r--systemCheck.py158
2 files changed, 159 insertions, 1 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 9df831aed..1047273d6 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -312,7 +312,7 @@ class Core(object):
if start == end: return True
- now = time.localtime()[3:5]
+ now = list(time.localtime()[3:5])
if start < now and end > now: return True
elif start > end and (now > start or now < end): return True
elif start < now and end < now and start > end: return True
diff --git a/systemCheck.py b/systemCheck.py
new file mode 100644
index 000000000..7227bc674
--- /dev/null
+++ b/systemCheck.py
@@ -0,0 +1,158 @@
+import os
+from os.path import dirname
+from os.path import exists
+from os.path import join
+import subprocess
+import sys
+
+def main():
+ print "##### System Information #####"
+ print ""
+ print "Platform:", sys.platform
+ print "Operating System:", os.name
+ print "Python:", sys.version.replace("\n", "")
+ print os.uname()
+ print ""
+
+ try:
+ import pycurl
+ print "pycurl:", pycurl.version
+ except:
+ print "pycurl:", "missing"
+
+ try:
+ import Crypto
+ print "py-crypto:", Crypto.__version__
+ except:
+ print "py-crypto:", "missing"
+
+
+ try:
+ import OpenSSL
+ print "OpenSSL:", OpenSSL.version.__version__
+ except:
+ print "OpenSSL:", "missing"
+
+ try:
+ import Image
+ print "image libary:", Image.VERSION
+ except:
+ print "image libary:", "missing"
+
+ try:
+ import django
+ print "django:", django.get_version()
+ except:
+ print "django:", "missing"
+
+ try:
+ import PyQt4
+ print "pyqt:", "4"
+ except:
+ print "pyqt:", "missing"
+
+ print ""
+ print ""
+ print "##### System Status #####"
+ print ""
+ print "## pyLoadCore ##"
+
+ core_err = []
+
+ if sys.version_info > (2, 7):
+ core_err.append("Your python version is to new, Please use Python 2.6")
+
+ if sys.version_info < (2, 5):
+ core_err.append("Your python version is to old, Please use at least Python 2.5")
+
+ try:
+ import pycurl
+ except:
+ core_err.append("Please install py-curl to use pyLoad.")
+
+ try:
+ import Image
+ except:
+ core_err.append("Please install py-imaging/pil to use Hoster, which uses captchas.")
+
+
+ pipe = subprocess.PIPE
+ try:
+ p = subprocess.call(["tesseract"], stdout=pipe, stderr=pipe)
+ except:
+ core_err.append("Please install tesseract to use Hoster, which uses captchas.")
+
+ try:
+ p = subprocess.call(["gocr"], stdout=pipe, stderr=pipe)
+ except:
+ core_err.append("Install gocr to use some Hoster, which uses captchas.")
+
+ try:
+ import OpenSSL
+ except:
+ core_err.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 ""
+ for err in core_err:
+ print err
+ else:
+ print "No Problems detected, pyLoadCore should work fine."
+
+
+ print ""
+ print "## pyLoadGui ##"
+
+ gui_err = []
+
+ try:
+ import PyQt4
+ except:
+ gui_err.append("GUI won't work without pyqt4 !!")
+
+
+ if gui_err:
+ print "The system check has detected some errors:"
+ print ""
+ for err in gui_err:
+ print err
+ else:
+ print "No Problems detected, pyLoadGui should work fine."
+
+ print ""
+ print "## Webinterface ##"
+
+ web_err = []
+
+ 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, 2):
+ web_err.append("Your django version is to new, please use django 1.1")
+
+ except:
+ web_err.append("Webinterface won't work without django !!")
+
+
+
+ if not exists(join(dirname(__file__), "module", "web", "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"))
+
+
+
+ if web_err:
+ print "The system check has detected some errors:"
+ print ""
+ for err in web_err:
+ print err
+ else:
+ print "No Problems detected, Webinterface should work fine."
+
+if __name__ == "__main__":
+ main() \ No newline at end of file