]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - bin/dependencies_b.py
Merge.
[irc/quakenet/qwebirc.git] / bin / dependencies_b.py
index e667b26ccef46c34942fb5717739f90b7cdd6bda..e02e875cba1f7417ab35450ad2662605572ed0f2 100644 (file)
@@ -1,8 +1,9 @@
-# this is seperate to allow us to use python 2.5 syntax without\r
+# this is separate to allow us to use python 2.5 syntax without\r
 # the dependency checker breaking on earlier versions.\r
 \r
 import sys\r
 import subprocess\r
+import os\r
 \r
 def fail(*message):\r
   print >>sys.stderr, "\n".join(message)\r
@@ -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/")\r
     \r
   try:\r
-    p = subprocess.Popen(["java", "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)\r
+    p = subprocess.Popen(["java", "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=os.name == "nt")\r
     p.communicate()\r
     if p.wait() != 0:\r
       java_warn("something went wrong looking for java.")\r
@@ -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/")\r
     \r
   try:\r
-    p = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)\r
+    p = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=os.name == "nt")\r
     p.communicate()\r
     if p.wait() != 0:\r
       hg_warn("something went wrong looking for mercurial.")\r
@@ -126,11 +127,18 @@ def check_json():
 \r
 def check_autobahn():\r
   try:\r
-    import autobahn.websocket\r
-    return 1\r
-  except ImportError:\r
-    warn("autobahn not installed; websocket support will be disabled")\r
+    import autobahn, autobahn.websocket\r
+    x = autobahn.version.split(".")\r
+    if len(x) != 3:\r
+      raise ImportError("Unknown version: %s", autobahn.vesrion)\r
+    if (int(x[1]) < 8) or (int(x[1]) == 8 and int(x[2]) < 14):\r
+      raise ImportError()\r
     return 0\r
+  except ImportError:\r
+    warn("autobahn 0.8.14 (minimum) not installed; websocket support will be disabled.",\r
+         "consider installing autobahn from:",\r
+         "http://autobahn.ws/python/getstarted/")\r
+    return 1\r
 \r
 if __name__ == "__main__":\r
   import dependencies\r