forked from pyload/pyload
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystemCheck.py
More file actions
120 lines (92 loc) · 2.87 KB
/
systemCheck.py
File metadata and controls
120 lines (92 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import os
import subprocess
import sys
#from module import InitHomeDir
def main():
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)
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 library: " + Image.VERSION)
except:
print("image library: missing")
print("\n\n##### System Status #####")
print("\n## pyLoadCore ##")
core_err = []
core_info = []
if sys.version_info > (2, 8):
core_err.append("Your python version is too new, Please use Python 2.6/2.7")
if sys.version_info < (2, 5):
core_err.append("Your python version is too old, Please use at least Python 2.5")
try:
import pycurl
except:
core_err.append("Please install py-curl to use pyLoad.")
try:
from pycurl import AUTOREFERER
except:
core_err.append("Your py-curl version is too old, please upgrade!")
try:
import Image
except:
core_err.append("Please install py-imaging/pil to use Hoster, which use captchas.")
pipe = subprocess.PIPE
try:
p = subprocess.call(["tesseract"], stdout=pipe, stderr=pipe)
except:
core_info.append("Install tesseract to try automatic captcha resolution.")
try:
import OpenSSL
except:
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:\n")
for err in core_err:
print(err)
else:
print("No Problems detected, pyLoadCore should work fine.")
if core_info:
print("\nPossible improvements for pyload:\n")
for line in core_info:
print(line)
print("\n## Webinterface ##")
web_err = []
web_info = []
try:
import flup
except:
web_info.append("Install Flup to use FastCGI or optional web servers.")
if web_err:
print("The system check has detected some errors:\n")
for err in web_err:
print(err)
else:
print("No Problems detected, web interface should work fine.")
if web_info:
print("\nPossible improvements for web interface:\n")
for line in web_info:
print(line)
if __name__ == "__main__":
main()
# comp. with py2 and 3
try:
input("Press Enter to Exit.")
except SyntaxError: # will raise in py2
pass