Thumbs.db
[dD]esktop.ini
static/{ugly,swm,mocha,q}ui{,debug}.html
+{bin/,}.checked
+{bin/,}.compiled
#!/usr/bin/env python
+import dependencies
+dependencies.vcheck()
+
import pages, os, subprocess, pagegen, shutil, sys
COPYRIGHT = open("js/copyright.js", "rb").read()
os.rmdir(coutputdir)
+ f = open(".compiled", "w")
+ f.close()
+
+def has_compiled():
+ try:
+ f = open(".compiled", "r")
+ f.close()
+ return True
+ except:
+ pass
+
+ try:
+ f = open(os.path.join("bin", ".compiled"), "r")
+ f.close()
+ return True
+ except:
+ pass
+
+ return False
+
+def vcheck():
+ if has_compiled():
+ return
+
+ print >>sys.stderr, "error: not yet compiled, run compile.py first."
+ sys.exit(1)
+
if __name__ == "__main__":
main()
\ No newline at end of file
--- /dev/null
+import sys\r
+\r
+def check_dependencies():\r
+ def fail(message):\r
+ sys.stderr.write(message + "\n")\r
+ sys.stderr.flush()\r
+ sys.exit(1)\r
+ \r
+ major, minor = sys.version_info[:2]\r
+ if major >= 3:\r
+ fail("qwebirc cannot run on python >=3 yet, install python 2.6.X:\nhttp://www.python.org/download/")\r
+ \r
+ if major < 2 or minor < 5:\r
+ 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])))\r
+ \r
+ # this is done so we can use Python 2.5 syntax...\r
+ import dependencies_b\r
+ dependencies_b.check_dependencies()\r
+\r
+def has_checked():\r
+ try:\r
+ f = open(".checked", "r")\r
+ f.close()\r
+ return True\r
+ except:\r
+ pass\r
+ \r
+ try:\r
+ f = open(os.path.join("bin", ".checked"), "r")\r
+ f.close()\r
+ return True\r
+ except:\r
+ pass\r
+ \r
+ return False\r
+ \r
+def vcheck():\r
+ if not has_checked():\r
+ sys.stderr.write("first run, checking dependencies...\n")\r
+ sys.stderr.flush()\r
+ check_dependencies()\r
+\r
+if __name__ == "__main__":\r
+ check_dependencies()\r
+
\ No newline at end of file
--- /dev/null
+# this is seperate 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
+\r
+def fail(*message):\r
+ print >>sys.stderr, "\n".join(message)\r
+ sys.exit(1)\r
+ \r
+def warn(*message):\r
+ print >>sys.stderr, "warning:", "\nwarning: ".join(message), "\n"\r
+\r
+def check_dependencies():\r
+ i = 0\r
+ \r
+ check_twisted()\r
+ check_win32()\r
+ i+=check_java()\r
+ i+=check_hg()\r
+ \r
+ print "0 errors, %d warnings." % i\r
+ \r
+ if i == 0:\r
+ print "looks like you've got everything you need to run qwebirc!"\r
+ else:\r
+ print "you can run qwebirc despite these."\r
+\r
+ f = open(".checked", "w")\r
+ f.close()\r
+ \r
+def check_win32():\r
+ if not sys.platform.startswith("win"):\r
+ return\r
+ \r
+ try:\r
+ import win32con\r
+ except ImportError:\r
+ fail("qwebirc requires pywin32, see:", "http://sourceforge.net/project/showfiles.php?group_id=78018")\r
+ \r
+def check_java():\r
+ def java_warn(specific):\r
+ 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.communicate()\r
+ if p.wait() != 0:\r
+ java_warn("something went wrong looking for java.")\r
+ return 1\r
+ except WindowsError:\r
+ java_warn("couldn't find java.")\r
+ return 1\r
+ \r
+ return 0\r
+ \r
+def check_hg():\r
+ def hg_warn(specific):\r
+ 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.communicate()\r
+ if p.wait() != 0:\r
+ hg_warn("something went wrong looking for mercurial.")\r
+ return 1\r
+ except WindowsError:\r
+ hg_warn("couldn't find mercurial.")\r
+ return 1\r
+ \r
+ return 0\r
+ \r
+def check_twisted():\r
+ try:\r
+ import twisted\r
+ except ImportError:\r
+ fail("qwebirc requires twisted (at least 8.2.0), see http://twistedmatrix.com/")\r
+\r
+ twisted_fail = lambda x, y=None: fail("you don't seem to have twisted's %s module." % x,\r
+ "your distro is most likely modular, look for a twisted web package%s." % (" %s" % y if y else "",))\r
+\r
+ try:\r
+ import twisted.names\r
+ except ImportError:\r
+ twisted_fail("names")\r
+\r
+ try:\r
+ import twisted.mail\r
+ except ImportError:\r
+ twisted_fail("mail")\r
+ fail("you don't seem to have twisted's mail module, your distro is most likely modular, look for a twisted mail package.")\r
+\r
+ try:\r
+ import twisted.web\r
+ except ImportError:\r
+ twisted_fail("web", "(not web2)")\r
+\r
+ try:\r
+ import twisted.words\r
+ except ImportError:\r
+ twistedfail("words")\r
+\r
+if __name__ == "__main__":\r
+ import dependencies\r
+ dependencies.check_dependencies()\r
tryunlink("static", "css", x + ".css")
tryunlink("static", "%s.html" % x)
tryunlink("static", "%sdebug.html" % x)
-
+ tryunlink(".checked")
+ tryunlink(".compiled")
+ tryunlink("bin", ".checked")
+ tryunlink("bin", ".compiled")
+
if __name__ == "__main__":
tryunlink("static", "js", "qwebirc.js")
cleanpyc.main()
#!/usr/bin/env python
# this entire thing is a hack and badly needs reimplementing
+import bin.compile
+bin.compile.vcheck()
+
DEFAULT_PORT = 9090
from twisted.scripts.twistd import run