]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Add default arguments to run.py.
authorChris Porter <redacted>
Tue, 17 Feb 2009 22:53:22 +0000 (22:53 +0000)
committerChris Porter <redacted>
Tue, 17 Feb 2009 22:53:22 +0000 (22:53 +0000)
config.py.example
run.py

index 0b53f34e5b1f7b3fda94b34d430295cdc46dcf0b..e6228d06c43df6fdfca7430fc9f0db2430511685 100644 (file)
@@ -16,3 +16,5 @@ FEEDBACK_SMTP_PORT = 25
 ADMIN_ENGINE_HOSTS = ["127.0.0.1"]
 HTTP_REQUEST_TIMEOUT = 5
 HTTP_AJAX_REQUEST_TIMEOUT = 30
+# optional default arguments:
+# ARGS = "-n -p 3989"
diff --git a/run.py b/run.py
index 11095fb766cf8899e0748c2703fa166b497c58eb..8011d56ae32fcf7d07f82d3d7792466910bd6819 100755 (executable)
--- a/run.py
+++ b/run.py
@@ -4,7 +4,7 @@ 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 = [], []