]>
Commit | Line | Data |
---|---|---|
1 | import sys | |
2 | ||
3 | def check_dependencies(): | |
4 | def fail(message): | |
5 | sys.stderr.write(message + "\n") | |
6 | sys.stderr.flush() | |
7 | sys.exit(1) | |
8 | ||
9 | major, minor = sys.version_info[:2] | |
10 | if major >= 3: | |
11 | fail("qwebirc cannot run on python >=3 yet, install python 2.6.X:\nhttp://www.python.org/download/") | |
12 | ||
13 | if major < 2 or minor < 5: | |
14 | fail("qwebirc requires python 2.5, you have: %s, install python 2.6.X:\nhttp://www.python.org/download/" % ".".join(map(str, sys.version_info[:3]))) | |
15 | ||
16 | # this is done so we can use Python 2.5 syntax... | |
17 | import dependencies_b | |
18 | dependencies_b.check_dependencies() | |
19 | ||
20 | def has_checked(): | |
21 | try: | |
22 | f = open(".checked", "r") | |
23 | f.close() | |
24 | return True | |
25 | except: | |
26 | pass | |
27 | ||
28 | try: | |
29 | f = open(os.path.join("bin", ".checked"), "r") | |
30 | f.close() | |
31 | return True | |
32 | except: | |
33 | pass | |
34 | ||
35 | return False | |
36 | ||
37 | def vcheck(): | |
38 | if not has_checked(): | |
39 | sys.stderr.write("first run, checking dependencies...\n") | |
40 | sys.stderr.flush() | |
41 | check_dependencies() | |
42 | ||
43 | if __name__ == "__main__": | |
44 | check_dependencies() | |
45 |