i+=check_autobahn()
i+=check_json()
i+=check_java()
- i+=check_hg()
-
+ i+=check_git()
+
print "0 errors, %d warnings." % i
if i == 0:
return 0
-def check_hg():
- def hg_warn(specific):
- 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/")
+def check_git():
+ def git_warn(specific):
+ warn(specific, "git is not required, but allows qwebirc to save bandwidth by versioning.")
try:
- p = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=os.name == "nt")
+ p = subprocess.Popen(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=os.name == "nt")
p.communicate()
if p.wait() != 0:
- hg_warn("something went wrong looking for mercurial.")
+ git_warn("something went wrong looking for git.")
return 1
except: # ugh
- hg_warn("couldn't find mercurial.")
+ git_warn("couldn't find git.")
return 1
return 0
return 0
def check_autobahn():
- try:
- import autobahn, autobahn.twisted.websocket
- x = autobahn.version.split(".")
- if len(x) != 3:
- raise ImportError()
- if (int(x[1]) < 8) or (int(x[1]) == 8 and int(x[2]) < 14):
- raise ImportError()
+ import qwebirc.util.autobahn_check as autobahn_check
+ v = autobahn_check.check()
+ if v == True:
return 0
- except ImportError:
- warn("autobahn 0.8.14 (minimum) not installed; websocket support will be disabled.",
+
+ if v == False:
+ warn("autobahn not installed; websocket support will be disabled.",
"consider installing autobahn from:",
"http://autobahn.ws/python/getstarted/")
return 1
+ warn("error loading autobahn: %s; websocket support will be disabled." % v,
+ "consider installing/upgrading autobahn from:",
+ "http://autobahn.ws/python/getstarted/")
+ return 1
+
if __name__ == "__main__":
import dependencies
dependencies.check_dependencies()