[Checkins] SVN: zc.monitorpdb/trunk/ initial import; no tests, but it works

Benji York benji at zope.com
Tue Oct 20 17:31:51 EDT 2009


Log message for revision 105186:
  initial import; no tests, but it works
  

Changed:
  A   zc.monitorpdb/trunk/buildout.cfg
  A   zc.monitorpdb/trunk/setup.py
  A   zc.monitorpdb/trunk/src/
  A   zc.monitorpdb/trunk/src/zc/
  A   zc.monitorpdb/trunk/src/zc/__init__.py
  A   zc.monitorpdb/trunk/src/zc/monitorpdb/
  A   zc.monitorpdb/trunk/src/zc/monitorpdb/README.txt
  A   zc.monitorpdb/trunk/src/zc/monitorpdb/__init__.py
  A   zc.monitorpdb/trunk/src/zc/monitorpdb/configure.zcml
  A   zc.monitorpdb/trunk/src/zc/monitorpdb/tests.py

-=-
Added: zc.monitorpdb/trunk/buildout.cfg
===================================================================
--- zc.monitorpdb/trunk/buildout.cfg	                        (rev 0)
+++ zc.monitorpdb/trunk/buildout.cfg	2009-10-20 21:31:51 UTC (rev 105186)
@@ -0,0 +1,12 @@
+[buildout]
+develop = .
+parts = test py
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = zc.monitorpdb
+
+[py]
+recipe = zc.recipe.egg
+eggs = ${test:eggs}
+interpreter = py

Added: zc.monitorpdb/trunk/setup.py
===================================================================
--- zc.monitorpdb/trunk/setup.py	                        (rev 0)
+++ zc.monitorpdb/trunk/setup.py	2009-10-20 21:31:51 UTC (rev 105186)
@@ -0,0 +1,39 @@
+##############################################################################
+#
+# Copyright (c) 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.
+#
+##############################################################################
+
+import os, setuptools
+
+
+def read(name):
+    fn = os.path.join(os.path.dirname(__file__), *name.split('/'))
+    with open(fn) as f:
+        return f.read()
+
+
+setuptools.setup(
+    name = 'zc.monitorpdb',
+    version = '0',
+    author = 'Benji York',
+    author_email = 'benji at zope.com',
+    description = 'zc.monitor plugin to debug running processes',
+    long_description = read('src/zc/monitorpdb/README.txt'),
+    license = 'ZPL 2.1',
+    include_package_data = True,
+    packages = setuptools.find_packages('src'),
+    namespace_packages = ['zc'],
+    package_dir = {'': 'src'},
+    install_requires = ['setuptools', 'zc.monitor'],
+    zip_safe = False,
+    extras_require = dict()
+    )


Property changes on: zc.monitorpdb/trunk/setup.py
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: zc.monitorpdb/trunk/src/zc/__init__.py
===================================================================
--- zc.monitorpdb/trunk/src/zc/__init__.py	                        (rev 0)
+++ zc.monitorpdb/trunk/src/zc/__init__.py	2009-10-20 21:31:51 UTC (rev 105186)
@@ -0,0 +1,5 @@
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)


Property changes on: zc.monitorpdb/trunk/src/zc/__init__.py
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: zc.monitorpdb/trunk/src/zc/monitorpdb/README.txt
===================================================================
--- zc.monitorpdb/trunk/src/zc/monitorpdb/README.txt	                        (rev 0)
+++ zc.monitorpdb/trunk/src/zc/monitorpdb/README.txt	2009-10-20 21:31:51 UTC (rev 105186)
@@ -0,0 +1,3 @@
+zc.z3monitor plugin to start a PDB in a running process
+=======================================================
+


Property changes on: zc.monitorpdb/trunk/src/zc/monitorpdb/README.txt
___________________________________________________________________
Added: svn:eol-style
   + native

Added: zc.monitorpdb/trunk/src/zc/monitorpdb/__init__.py
===================================================================
--- zc.monitorpdb/trunk/src/zc/monitorpdb/__init__.py	                        (rev 0)
+++ zc.monitorpdb/trunk/src/zc/monitorpdb/__init__.py	2009-10-20 21:31:51 UTC (rev 105186)
@@ -0,0 +1,41 @@
+##############################################################################
+#
+# Copyright (c) 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.
+#
+##############################################################################
+
+import pdb
+import sys
+
+class FakeStdout(object):
+    def __init__(self, connection):
+        self.connection = connection
+
+    def flush(self):
+        pass
+
+    def write(self, *args):
+        return self.connection.write(*args)
+
+
+debugger = fakeout = None
+
+
+def command(lines, *args):
+    global debugger
+    global fakeout
+    if debugger is None:
+        fakeout = FakeStdout(lines.connection)
+        debugger = pdb.Pdb(stdin=None, stdout=fakeout)
+        debugger.reset()
+        debugger.setup(sys._getframe().f_back, None)
+
+    debugger.onecmd(' '.join(args))


Property changes on: zc.monitorpdb/trunk/src/zc/monitorpdb/__init__.py
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: zc.monitorpdb/trunk/src/zc/monitorpdb/configure.zcml
===================================================================
--- zc.monitorpdb/trunk/src/zc/monitorpdb/configure.zcml	                        (rev 0)
+++ zc.monitorpdb/trunk/src/zc/monitorpdb/configure.zcml	2009-10-20 21:31:51 UTC (rev 105186)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configure xmlns="http://namespaces.zope.org/zope">
+  <utility
+     factory=".RootRegistedMonitor"
+     provides="zc.z3monitor.interfaces.IZ3MonitorPlugin"
+     name="logstats"
+     />
+</configure>


Property changes on: zc.monitorpdb/trunk/src/zc/monitorpdb/configure.zcml
___________________________________________________________________
Added: svn:eol-style
   + native

Added: zc.monitorpdb/trunk/src/zc/monitorpdb/tests.py
===================================================================
--- zc.monitorpdb/trunk/src/zc/monitorpdb/tests.py	                        (rev 0)
+++ zc.monitorpdb/trunk/src/zc/monitorpdb/tests.py	2009-10-20 21:31:51 UTC (rev 105186)
@@ -0,0 +1,43 @@
+##############################################################################
+#
+# Copyright (c) Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (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.
+#
+##############################################################################
+import datetime
+import unittest
+from zope.testing import doctest, setupstack
+
+def setUp(test):
+
+    class FauxDateTime:
+
+        now = datetime.datetime(2008, 9, 5, 21, 10, 13)
+
+        @classmethod
+        def utcnow(self):
+            self.now += datetime.timedelta(seconds=1)
+            return self.now
+
+    datetime_orig = datetime.datetime
+    def restore():
+        datetime.datetime = datetime_orig
+
+    setupstack.register(test, restore)
+
+    datetime.datetime = FauxDateTime
+
+def test_suite():
+    return unittest.TestSuite((
+        doctest.DocFileSuite(
+            'README.txt',
+            setUp=setUp, tearDown=setupstack.tearDown),
+        ))
+


Property changes on: zc.monitorpdb/trunk/src/zc/monitorpdb/tests.py
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native



More information about the checkins mailing list