From 0ffca9a1f6f0b5470d219844f44f010ee4ef4b02 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 26 Feb 2010 14:49:19 +0000 Subject: [PATCH] Fix silly error from last commit --- deluge/ui/web/web.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/deluge/ui/web/web.py b/deluge/ui/web/web.py index 6fcd2227e..c4e51b343 100644 --- a/deluge/ui/web/web.py +++ b/deluge/ui/web/web.py @@ -60,7 +60,7 @@ class Web(_UI): help="Sets the port to be used for the webserver", action="store", default=None) group.add_option("--profile", dest="profile", - help="Profile the web server code" + help="Profile the web server code", action="store_true", default=False) try: import OpenSSL @@ -118,6 +118,15 @@ class Web(_UI): self.server.install_signal_handlers() self.server.start() + if self.options.profile: + hsp.stop() + hsp.close() + import hotshot.stats + stats = hotshot.stats.load(deluge.configmanager.get_config_dir("deluge-web.profile")) + stats.strip_dirs() + stats.sort_stats("time", "calls") + stats.print_stats(400) + def start(): web = Web() web.start()