zope.app.debug-3.4.1/0000755000076400007640000000000010751052744014605 5ustar srichtersrichterzope.app.debug-3.4.1/src/0000755000076400007640000000000010751052744015374 5ustar srichtersrichterzope.app.debug-3.4.1/src/zope/0000755000076400007640000000000010751052744016351 5ustar srichtersrichterzope.app.debug-3.4.1/src/zope/app/0000755000076400007640000000000010751052744017131 5ustar srichtersrichterzope.app.debug-3.4.1/src/zope/app/debug/0000755000076400007640000000000010751052744020217 5ustar srichtersrichterzope.app.debug-3.4.1/src/zope/app/debug/__init__.py0000644000076400007640000000145410707521502022326 0ustar srichtersrichter############################################################################## # # Copyright (c) 2004 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Zope Application debugger package $Id: __init__.py 26725 2004-07-23 21:11:32Z pruggera $ """ __docformat__ = 'restructuredtext' from zope.app.debug.debug import Debugger zope.app.debug-3.4.1/src/zope/app/debug/debug.py0000644000076400007640000001244710750642533021667 0ustar srichtersrichter############################################################################## # # Copyright (c) 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Code to initialize the application server $Id: debug.py 83383 2008-02-01 15:20:41Z adamg $ """ __docformat__ = 'restructuredtext' import base64, time import urllib from StringIO import StringIO from zope.publisher.publish import publish as _publish, debug_call from zope.publisher.browser import TestRequest, setDefaultSkin from zope.app.publication.browser import BrowserPublication from zope.app.appsetup import config, database class Debugger(object): def __init__(self, db=None, config_file=None): if db is None and config_file is None: db = 'Data.fs' config_file = 'site.zcml' if config_file is not None: config(config_file) self.db = database(db) def fromDatabase(cls, db): inst = cls.__new__(cls) inst.db = db return inst fromDatabase = classmethod(fromDatabase) def root(self): """Get the top-level application object The object returned is connected to an open database connection. """ from zope.app.publication.zopepublication import ZopePublication return self.db.open().root()[ZopePublication.root_name] def _request(self, path='/', stdin='', basic=None, environment = None, form=None, request=None, publication=BrowserPublication): """Create a request """ env = {} if type(stdin) is str: stdin = StringIO(stdin) p=path.split('?') if len(p)==1: env['PATH_INFO'] = p[0] elif len(p)==2: env['PATH_INFO'], env['QUERY_STRING'] = p else: raise ValueError("Too many ?s in path", path) env['PATH_INFO'] = urllib.unquote(env['PATH_INFO']) if environment is not None: env.update(environment) if basic: env['HTTP_AUTHORIZATION']="Basic %s" % base64.encodestring(basic) pub = publication(self.db) if request is not None: request = request(stdin, env) else: request = TestRequest(stdin, env) setDefaultSkin(request) request.setPublication(pub) if form: # This requires that request class has an attribute 'form' # (BrowserRequest has, TestRequest hasn't) request.form.update(form) return request def publish(self, path='/', stdin='', *args, **kw): t, c = time.time(), time.clock() request = self._request(path, stdin, *args, **kw) # agroszer: 2008.feb.1.: if a retry occurs in the publisher, # the response will be LOST, so we must accept the returned request request = _publish(request) getStatus = getattr(request.response, 'getStatus', lambda: None) headers = request.response.getHeaders() headers.sort() print 'Status %s\r\n%s\r\n\r\n%s' % ( request.response.getStatusString(), '\r\n'.join([("%s: %s" % h) for h in headers]), request.response.consumeBody(), ) return time.time()-t, time.clock()-c, getStatus() def run(self, *args, **kw): t, c = time.time(), time.clock() request = self._request(*args, **kw) # agroszer: 2008.feb.1.: if a retry occurs in the publisher, # the response will be LOST, so we must accept the returned request request = _publish(request, handle_errors=False) getStatus = getattr(request.response, 'getStatus', lambda: None) return time.time()-t, time.clock()-c, getStatus() def debug(self, *args, **kw): import pdb class Pdb(pdb.Pdb): def do_pub(self,arg): if hasattr(self,'done_pub'): print 'pub already done.' else: self.do_s('') self.do_s('') self.do_c('') self.done_pub=1 def do_ob(self,arg): if hasattr(self,'done_ob'): print 'ob already done.' else: self.do_pub('') self.do_c('') self.done_ob=1 db=Pdb() request = self._request(*args, **kw) fbreak(db, _publish) fbreak(db, debug_call) print '* Type c to jump to published object call.' db.runcall(_publish, request) def fbreak(db, meth): try: meth = meth.im_func except AttributeError: pass code = meth.func_code lineno = getlineno(code) filename = code.co_filename db.set_break(filename,lineno) try: from codehack import getlineno except: def getlineno(code): return code.co_firstlineno zope.app.debug-3.4.1/src/zope/app/__init__.py0000644000076400007640000000031010707521502021226 0ustar srichtersrichter# this is a namespace package try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) zope.app.debug-3.4.1/src/zope/__init__.py0000644000076400007640000000031010707521502020446 0ustar srichtersrichter# this is a namespace package try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) zope.app.debug-3.4.1/src/zope.app.debug.egg-info/0000755000076400007640000000000010751052744021707 5ustar srichtersrichterzope.app.debug-3.4.1/src/zope.app.debug.egg-info/PKG-INFO0000644000076400007640000000246010751052744023006 0ustar srichtersrichterMetadata-Version: 1.0 Name: zope.app.debug Version: 3.4.1 Summary: Zope Debug Mode Home-page: http://cheeseshop.python.org/pypi/zope.app.debug Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: This package provides a debugger for the Zope publisher. After Zope is isntantiated, it drops the user into an interactive Python shell where the full Zope environment and the database root are available. ======= CHANGES ======= 3.4.1 (2008-02-02) ------------------ - Fix of 599 error on conflict error in request see: http://mail.zope.org/pipermail/zope-dev/2008-January/030844.html 3.4.0 (2007-10-23) ------------------ - Initial release independent of the main Zope tree. Keywords: zope3 webdav Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.app.debug-3.4.1/src/zope.app.debug.egg-info/SOURCES.txt0000644000076400007640000000072010751052744023572 0ustar srichtersrichterCHANGES.txt README.txt bootstrap.py buildout.cfg setup.py src/zope/__init__.py src/zope.app.debug.egg-info/PKG-INFO src/zope.app.debug.egg-info/SOURCES.txt src/zope.app.debug.egg-info/dependency_links.txt src/zope.app.debug.egg-info/namespace_packages.txt src/zope.app.debug.egg-info/not-zip-safe src/zope.app.debug.egg-info/requires.txt src/zope.app.debug.egg-info/top_level.txt src/zope/app/__init__.py src/zope/app/debug/__init__.py src/zope/app/debug/debug.py zope.app.debug-3.4.1/src/zope.app.debug.egg-info/dependency_links.txt0000644000076400007640000000000110751052744025755 0ustar srichtersrichter zope.app.debug-3.4.1/src/zope.app.debug.egg-info/namespace_packages.txt0000644000076400007640000000001610751052744026237 0ustar srichtersrichterzope zope.app zope.app.debug-3.4.1/src/zope.app.debug.egg-info/not-zip-safe0000644000076400007640000000000110707524613024135 0ustar srichtersrichter zope.app.debug-3.4.1/src/zope.app.debug.egg-info/requires.txt0000644000076400007640000000013110751052744024302 0ustar srichtersrichtersetuptools zope.publisher zope.app.appsetup zope.app.publication [test] zope.app.testingzope.app.debug-3.4.1/src/zope.app.debug.egg-info/top_level.txt0000644000076400007640000000000510751052744024434 0ustar srichtersrichterzope zope.app.debug-3.4.1/CHANGES.txt0000644000076400007640000000042510751052435016414 0ustar srichtersrichter======= CHANGES ======= 3.4.1 (2008-02-02) ------------------ - Fix of 599 error on conflict error in request see: http://mail.zope.org/pipermail/zope-dev/2008-January/030844.html 3.4.0 (2007-10-23) ------------------ - Initial release independent of the main Zope tree. zope.app.debug-3.4.1/README.txt0000644000076400007640000000031510707522027016277 0ustar srichtersrichterThis package provides a debugger for the Zope publisher. After Zope is isntantiated, it drops the user into an interactive Python shell where the full Zope environment and the database root are available. zope.app.debug-3.4.1/bootstrap.py0000644000076400007640000000337010707521502017171 0ustar srichtersrichter############################################################################## # # Copyright (c) 2006 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Bootstrap a buildout-based project Simply run this script in a directory containing a buildout.cfg. The script accepts buildout command-line options, so you can use the -c option to specify an alternate configuration file. $Id: bootstrap.py 73574 2007-03-25 09:57:29Z dobe $ """ import os, shutil, sys, tempfile, urllib2 tmpeggs = tempfile.mkdtemp() ez = {} exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' ).read() in ez ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) import pkg_resources cmd = 'from setuptools.command.easy_install import main; main()' if sys.platform == 'win32': cmd = '"%s"' % cmd # work around spawn lamosity on windows ws = pkg_resources.working_set assert os.spawnle( os.P_WAIT, sys.executable, sys.executable, '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', dict(os.environ, PYTHONPATH= ws.find(pkg_resources.Requirement.parse('setuptools')).location ), ) == 0 ws.add_entry(tmpeggs) ws.require('zc.buildout') import zc.buildout.buildout zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) shutil.rmtree(tmpeggs) zope.app.debug-3.4.1/buildout.cfg0000644000076400007640000000015010707521566017115 0ustar srichtersrichter[buildout] develop = . parts = test [test] recipe = zc.recipe.testrunner eggs = zope.app.debug [test] zope.app.debug-3.4.1/setup.py0000644000076400007640000000417510751052676016332 0ustar srichtersrichter############################################################################## # # Copyright (c) 2006 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Setup for zope.app.debug package $Id: setup.py 83408 2008-02-02 11:36:29Z srichter $ """ import os from setuptools import setup, find_packages def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() setup(name='zope.app.debug', version = '3.4.1', author='Zope Corporation and Contributors', author_email='zope-dev@zope.org', description='Zope Debug Mode', long_description=( read('README.txt') + '\n\n' + read('CHANGES.txt') ), keywords = "zope3 webdav", classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: Zope Public License', 'Programming Language :: Python', 'Natural Language :: English', 'Operating System :: OS Independent', 'Topic :: Internet :: WWW/HTTP', 'Framework :: Zope3'], url='http://cheeseshop.python.org/pypi/zope.app.debug', license='ZPL 2.1', packages=find_packages('src'), package_dir = {'': 'src'}, namespace_packages=['zope', 'zope.app'], extras_require = dict(test=['zope.app.testing']), install_requires=['setuptools', 'zope.publisher', 'zope.app.appsetup', 'zope.app.publication' ], include_package_data = True, zip_safe = False, ) zope.app.debug-3.4.1/PKG-INFO0000644000076400007640000000246010751052744015704 0ustar srichtersrichterMetadata-Version: 1.0 Name: zope.app.debug Version: 3.4.1 Summary: Zope Debug Mode Home-page: http://cheeseshop.python.org/pypi/zope.app.debug Author: Zope Corporation and Contributors Author-email: zope-dev@zope.org License: ZPL 2.1 Description: This package provides a debugger for the Zope publisher. After Zope is isntantiated, it drops the user into an interactive Python shell where the full Zope environment and the database root are available. ======= CHANGES ======= 3.4.1 (2008-02-02) ------------------ - Fix of 599 error on conflict error in request see: http://mail.zope.org/pipermail/zope-dev/2008-January/030844.html 3.4.0 (2007-10-23) ------------------ - Initial release independent of the main Zope tree. Keywords: zope3 webdav Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Programming Language :: Python Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: Zope3 zope.app.debug-3.4.1/setup.cfg0000644000076400007640000000007310751052744016426 0ustar srichtersrichter[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0