From 44b5ae07bab97be64ca90bdfe85950cb8a88d21f Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 5 Feb 2012 17:39:43 +0100 Subject: [PATCH] Fixed an issue that didn't allow the runner to launch profiled Portal in interactive mode. --- game/runner.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/game/runner.py b/game/runner.py index 656d7bec47..a0163a52da 100644 --- a/game/runner.py +++ b/game/runner.py @@ -259,11 +259,12 @@ def main(): # don't log to server logfile del server_argv[2] print _("\nStarting Evennia Server (output to stdout).") - elif options.sprof: - server_argv.extend(sprof_argv) - print "\nRunning Evennia Server under cProfile." else: print _("\nStarting Evennia Server (output to server logfile).") + if options.sprof: + server_argv.extend(sprof_argv) + print "\nRunning Evennia Server under cProfile." + cycle_logfile(SERVER_LOGFILE) # Portal @@ -281,12 +282,13 @@ def main(): PORTAL_INTERACTIVE = True set_restart_mode(PORTAL_RESTART, True) print _("\nStarting Evennia Portal in non-Daemon mode (output to stdout).") - elif options.pprof: - server_argv.extend(pprof_argv) - print "\nRunning Evennia Portal under cProfile." else: set_restart_mode(PORTAL_RESTART, False) print _("\nStarting Evennia Portal in Daemon mode (output to portal logfile).") + if options.pprof: + server_argv.extend(pprof_argv) + print "\nRunning Evennia Portal under cProfile." + cycle_logfile(PORTAL_LOGFILE) # Windows fixes (Windows don't support pidfiles natively)