[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/utilities/runurl.py
Merged fix from trunk (25246)
Jim Fulton
jim at zope.com
Fri Jun 4 11:33:17 EDT 2004
Log message for revision 25256:
Merged fix from trunk (25246)
-=-
Modified: Zope3/branches/ZopeX3-3.0/utilities/runurl.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/utilities/runurl.py 2004-06-04 15:29:48 UTC (rev 25255)
+++ Zope3/branches/ZopeX3-3.0/utilities/runurl.py 2004-06-04 15:33:17 UTC (rev 25256)
@@ -72,7 +72,7 @@
import sys, os, getopt
def main(argv=None):
- global app, path, basic, run, stdin, env
+ global app, path, basic, run, stdin, env, debugger
if argv is None:
argv = sys.argv
@@ -135,13 +135,14 @@
env[name]=value
app = _doimport(script, src)
- app = app.Application(database, config)
+ from zope.app.debug import Debugger
+ debugger = Debugger(database, config)
if warm:
- _mainrun(app, path, basic, 1, stdin, env)
+ _mainrun(debugger, path, basic, 1, stdin, env)
if profilef or hotshotf:
- cmd = "_mainrun(app, path, basic, run, stdin, env)"
+ cmd = "_mainrun(debugger, path, basic, run, stdin, env)"
if profilef:
import profile
profile.run(cmd, profilef)
@@ -160,16 +161,16 @@
print 'Wrote', hotshotf
else:
- _mainrun(app, path, basic, run, stdin, env)
+ _mainrun(debugger, path, basic, run, stdin, env)
resultfmt = "elapsed: %.4f, cpu=%.4f, status=%s"
-def _mainrun(app, path, basic, run, stdin, environment):
+def _mainrun(debugger, path, basic, run, stdin, environment):
if run:
es = []
cs = []
for i in range(run):
- e, c, status = app.run(path=path, basic=basic, stdin=stdin,
- environment=environment)
+ e, c, status = debugger.run(path=path, basic=basic, stdin=stdin,
+ environment=environment)
es.append(e)
cs.append(c)
print resultfmt % (e, c, status)
@@ -182,8 +183,8 @@
c = (cs[(run+1)/2-1]+cs[(run+2)/2-1]) / 2.0
print "med elapsted: %.4f, med cpu=%.4f" % (e, c)
else:
- print resultfmt % app.publish(path=path, basic=basic, stdin=stdin,
- environment=environment)
+ print resultfmt % debugger.publish(path=path, basic=basic, stdin=stdin,
+ environment=environment)
def _doimport(script, src):
More information about the Zope3-Checkins
mailing list