Author: chrisz
Date: Thu Sep 29 13:42:44 2005
New Revision: 3354
Modified:
Webware/trunk/WebKit/AppServer.py
Webware/trunk/WebKit/Launch.py
Log:
Restore compatibility with Launch scripts created by old version of MakeAppWorkDir.
Modified: Webware/trunk/WebKit/AppServer.py
==============================================================================
--- Webware/trunk/WebKit/AppServer.py (original)
+++ Webware/trunk/WebKit/AppServer.py Thu Sep 29 13:42:44 2005
@@ -126,6 +126,8 @@
accept requests. Records some stats and prints a message.
"""
+ if Profiler.startTime is None:
+ Profiler.startTime = self._startTime
Profiler.readyTime = time.time()
Profiler.readyDuration = Profiler.readyTime - Profiler.startTime
print "Ready (%.2f seconds after launch)\n" % Profiler.readyDuration
Modified: Webware/trunk/WebKit/Launch.py
==============================================================================
--- Webware/trunk/WebKit/Launch.py (original)
+++ Webware/trunk/WebKit/Launch.py Thu Sep 29 13:42:44 2005
@@ -118,6 +118,11 @@
except ImportError:
print 'Error: Cannot import the app server module.'
sys.exit(1)
+ # Set Profiler.startTime if this has not been done already:
+ from WebKit import Profiler
+ if Profiler.startTime is None:
+ from time import time
+ Profiler.startTime = time()
# Run the app server:
appServerMain(args) # go!
@@ -367,8 +372,9 @@
print
# Set up a reference to our profiler so apps can import and use it:
from WebKit import Profiler
- from time import time
- Profiler.startTime = time()
+ if Profiler.startTime is None:
+ from time import time
+ Profiler.startTime = time()
# Now start the app server:
if runProfile:
print 'Profiling is on. See docstring in Profiler.py for more info.'
|