X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/blobdiff_plain/8b8ebb7815316b0a71e6169f40f4acf3876bab98..1d924d975da119681e9ed30346847ae3079d51af:/run.py diff --git a/run.py b/run.py old mode 100644 new mode 100755 index 4430324..11095fb --- a/run.py +++ b/run.py @@ -1,5 +1,5 @@ #!/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 @@ -26,6 +26,7 @@ parser = OptionParser() parser.add_option("-n", "--no-daemon", help="Don't run in the background.", action="store_false", dest="daemonise", default=True) parser.add_option("--help-reactors", help="Display a list of reactor names.", action="callback", callback=help_reactors) parser.add_option("-b", "--debug", help="Run in the Python Debugger.", action="store_true", dest="debug", default=False) +parser.add_option("-t", "--tracebacks", help="Display tracebacks in error pages (this reveals a LOT of information, do NOT use in production!)", action="store_true", dest="tracebacks", default=False) parser.add_option("-r", "--reactor", help="Which reactor to use (see --help-reactors for a list).", dest="reactor", default=DEFAULT_REACTOR) 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") @@ -38,12 +39,16 @@ 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] args2+=["--port", options.port] +if not options.tracebacks: + args2.append("-n") if options.clogfile: args2+=["--logfile", options.clogfile] - + run_twistd(args1, args2)