]>
jfr.im git - irc/quakenet/qwebirc.git/blob - bin/dependencies_b.py
1 # this is separate to allow us to use python 2.5 syntax without
2 # the dependency checker breaking on earlier versions.
9 print >> sys
. stderr
, " \n " . join ( message
)
13 print >> sys
. stderr
, "warning:" , " \n warning: " . join ( message
), " \n "
15 def check_dependencies ():
26 print "0 errors, %d warnings." % i
29 print "looks like you've got everything you need to run qwebirc!"
31 print "you can run qwebirc despite these."
33 f
= open ( ".checked" , "w" )
37 if not sys
. platform
. startswith ( "win" ):
43 fail ( "qwebirc requires pywin32, see:" , "http://sourceforge.net/project/showfiles.php?group_id=78018" )
46 def java_warn ( specific
):
47 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/" )
50 p
= subprocess
. Popen ([ "java" , "-version" ], stdout
= subprocess
. PIPE
, stderr
= subprocess
. PIPE
, shell
= os
. name
== "nt" )
53 java_warn ( "something went wrong looking for java." )
56 java_warn ( "couldn't find java." )
62 def git_warn ( specific
):
63 warn ( specific
, "git is not required, but allows qwebirc to save bandwidth by versioning." )
66 p
= subprocess
. Popen ([ "git" , "rev-parse" , "HEAD" ], stdout
= subprocess
. PIPE
, stderr
= subprocess
. PIPE
, shell
= os
. name
== "nt" )
69 git_warn ( "something went wrong looking for git." )
72 git_warn ( "couldn't find git." )
79 from zope
. interface
import Interface
81 if sys
. platform
. startswith ( "win" ):
82 fail ( "qwebirc requires zope interface" ,
83 "see pypi: http://pypi.python.org/pypi/zope.interface" )
85 fail ( "qwebirc requires zope interface." ,
86 "this should normally come with twisted, but can be downloaded" ,
87 "from pypi: http://pypi.python.org/pypi/zope.interface" )
93 fail ( "qwebirc requires twisted (at least 8.2.0), see http://twistedmatrix.com/" )
95 def twisted_fail ( x
, y
= None ):
96 fail ( "you don't seem to have twisted's %s module." % x
,
97 "your distro is most likely modular, look for a twisted %s package %s ." % ( x
, " %s " % y
if y
else "" ,))
102 twisted_fail ( "names" )
112 twisted_fail ( "web" , "(not web2)" )
117 twisted_fail ( "words" )
120 import qwebirc
. util
. qjson
121 if qwebirc
. util
. qjson
. slow
:
122 warn ( "simplejson module with C speedups not installed." ,
123 "using embedded module (slower); consider installing simplejson from:" ,
124 "http://pypi.python.org/pypi/simplejson/" )
128 def check_autobahn ():
130 import autobahn
, autobahn
. twisted
. websocket
131 x
= autobahn
. version
. split ( "." )
134 if ( int ( x
[ 1 ]) < 8 ) or ( int ( x
[ 1 ]) == 8 and int ( x
[ 2 ]) < 14 ):
138 warn ( "autobahn 0.8.14 (minimum) not installed; websocket support will be disabled." ,
139 "consider installing autobahn from:" ,
140 "http://autobahn.ws/python/getstarted/" )
143 if __name__
== "__main__" :
145 dependencies
. check_dependencies ()