X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/blobdiff_plain/badf1db9a8c18bd50beeabe4b641aa613948f826..52f5b0e37b783d6e0926fce4f9a8e4f8e315c738:/bin/dependencies_b.py diff --git a/bin/dependencies_b.py b/bin/dependencies_b.py index 94663ce..e02e875 100644 --- a/bin/dependencies_b.py +++ b/bin/dependencies_b.py @@ -1,8 +1,9 @@ -# this is seperate to allow us to use python 2.5 syntax without +# this is separate to allow us to use python 2.5 syntax without # the dependency checker breaking on earlier versions. import sys import subprocess +import os def fail(*message): print >>sys.stderr, "\n".join(message) @@ -46,7 +47,7 @@ def check_java(): warn(specific, "java is not required, but allows qwebirc to compress output,", "making it faster to download.", "you can get java at http://www.java.com/") try: - p = subprocess.Popen(["java", "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p = subprocess.Popen(["java", "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=os.name == "nt") p.communicate() if p.wait() != 0: java_warn("something went wrong looking for java.") @@ -62,7 +63,7 @@ def check_hg(): warn(specific, "mercurial (hg) is not required, but allows qwebirc to save bandwidth by versioning.", "you can get hg at http://www.selenic.com/mercurial/") try: - p = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=os.name == "nt") p.communicate() if p.wait() != 0: hg_warn("something went wrong looking for mercurial.") @@ -126,10 +127,15 @@ def check_json(): def check_autobahn(): try: - import autobahn.websocket + import autobahn, autobahn.websocket + x = autobahn.version.split(".") + if len(x) != 3: + raise ImportError("Unknown version: %s", autobahn.vesrion) + if (int(x[1]) < 8) or (int(x[1]) == 8 and int(x[2]) < 14): + raise ImportError() return 0 except ImportError: - warn("autobahn not installed; websocket support will be disabled.", + warn("autobahn 0.8.14 (minimum) not installed; websocket support will be disabled.", "consider installing autobahn from:", "http://autobahn.ws/python/getstarted/") return 1