[Zope3-checkins] SVN: Zope3/trunk/utilities/runurl.py Updated to
reflect split of zope._app into the debug package.
Jim Fulton
jim at zope.com
Thu Jun 3 20:49:27 EDT 2004
Log message for revision 25246:
Updated to reflect split of zope._app into the debug package.
This code really needs to be moved there.
-=-
Modified: Zope3/trunk/utilities/runurl.py
===================================================================
--- Zope3/trunk/utilities/runurl.py 2004-06-03 21:15:31 UTC (rev 25245)
+++ Zope3/trunk/utilities/runurl.py 2004-06-04 00:49:24 UTC (rev 25246)
@@ -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