]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - run.py
Add WEBIRC support, along with hex idents.
[irc/quakenet/qwebirc.git] / run.py
diff --git a/run.py b/run.py
old mode 100644 (file)
new mode 100755 (executable)
index be396a8..8011d56
--- a/run.py
+++ b/run.py
@@ -1,10 +1,10 @@
 #!/usr/bin/env python
-# this entire thing is a hack
+# this entire thing is a hack and badly needs reimplementing
 DEFAULT_PORT = 9090
 
 from twisted.scripts.twistd import run
 from optparse import OptionParser
-import sys, os
+import sys, os, config
 
 def run_twistd(args1=None, args2=None):
   args = [sys.argv[0]]
@@ -31,7 +31,13 @@ parser.add_option("-r", "--reactor", help="Which reactor to use (see --help-reac
 parser.add_option("-p", "--port", help="Port to start the server on.", type="int", dest="port", default=DEFAULT_PORT)
 parser.add_option("-l", "--logfile", help="Path to twisted log file.", dest="logfile")
 parser.add_option("-c", "--clf", help="Path to web CLF (Combined Log Format) log file.", dest="clogfile")
-(options, args) = parser.parse_args()
+
+sargs = sys.argv[1:]
+if "ARGS" in dir(config):
+  import shlex
+  sargs = shlex.split(config.ARGS) + sargs
+
+(options, args) = parser.parse_args(args=sargs)
 
 args1, args2 = [], []
 
@@ -39,7 +45,9 @@ if not options.daemonise:
   args1.append("-n")
 if options.debug:
   args1.append("-b")
-args1+=["--reactor", options.reactor]
+
+if options.reactor != DEFAULT_REACTOR:
+  args1+=["--reactor", options.reactor]
 if options.logfile:
   args+=["--logfile", options.logfile]