[Checkins] SVN: zope.applicationcontrol/trunk/ First stab at this.

Martijn Faassen faassen at startifact.com
Sat Jan 9 09:12:52 EST 2010


Log message for revision 107926:
  First stab at this.
  

Changed:
  U   zope.applicationcontrol/trunk/CHANGES.txt
  D   zope.applicationcontrol/trunk/INSTALL.txt
  U   zope.applicationcontrol/trunk/README.txt
  U   zope.applicationcontrol/trunk/buildout.cfg
  U   zope.applicationcontrol/trunk/setup.py
  D   zope.applicationcontrol/trunk/src/zope/app/
  A   zope.applicationcontrol/trunk/src/zope/applicationcontrol/
  U   zope.applicationcontrol/trunk/src/zope/applicationcontrol/applicationcontrol.py
  D   zope.applicationcontrol/trunk/src/zope/applicationcontrol/browser/
  U   zope.applicationcontrol/trunk/src/zope/applicationcontrol/interfaces.py
  U   zope.applicationcontrol/trunk/src/zope/applicationcontrol/runtimeinfo.py
  U   zope.applicationcontrol/trunk/src/zope/applicationcontrol/tests/test_applicationcontrol.py
  U   zope.applicationcontrol/trunk/src/zope/applicationcontrol/tests/test_runtimeinfo.py
  D   zope.applicationcontrol/trunk/src/zope/applicationcontrol/tests/test_zopeversion.py
  D   zope.applicationcontrol/trunk/src/zope/applicationcontrol/zopeversion.py

-=-
Modified: zope.applicationcontrol/trunk/CHANGES.txt
===================================================================
--- zope.applicationcontrol/trunk/CHANGES.txt	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/CHANGES.txt	2010-01-09 14:12:52 UTC (rev 107926)
@@ -5,72 +5,4 @@
 3.5.5 (unreleased)
 ------------------
 
-- Nothing changed yet.
-
-
-3.5.4 (2010-01-08)
-------------------
-
-- Test dependency on zptpage removed.
-
-
-3.5.3 (2010-01-05)
-------------------
-
-- Updated to use newer zope.publisher 3.12 and zope.login to make
-  tests work.
-
-
-Version 3.5.2 (2009-12-19)
---------------------------
-
-- Move 'zope.ManageApplication' permission from zope.app.security package
-
-- Break dependency on ``zope.app.appsetup`` by using a conditional import
-
-
-Version 3.5.1 (2009-08-15)
---------------------------
-
-- Added missing (normal and test) dependencies.
-
-- Renenabled functional tests.
-
-Version 3.5.0 (2009-05-23)
---------------------------
-
-- The application controller is now registered as a utility so that other
-  packages like zope.traversing and zope.app.publication do not need
-  to depend on this package directly.  This also makes the application
-  controller pluggable.
-
-Version 3.4.3 (2008-07-30)
---------------------------
-
-- Make the test for the ZopeVersion bugfix in 3.4.2 not fail when run from an
-  egg rather than a checkout.
-
-Version 3.4.2 (2008-07-30)
---------------------------
-
-- Substitute zope.app.zapi by direct calls to its wrapped apis.
-  See http://launchpad.net/bugs/219302
-
-- Bugfix: ZopeVersion used to report an unknown version when running on a
-  machine with a locale different than English.
-  See http://launchpad.net/bugs/177733
-
-- Fixed deprecation warning in ftesting.zcml: import ZopeSecurityPolicy from
-  the new location.
-
-Version 3.4.1 (2007-09-27)
---------------------------
-
-- rebumped to replace faulty egg
-
-Version 3.4.0 (2007-09-25)
---------------------------
-
-- Initial documented release
-
-- Reflect changes form zope.app.error refactoring
+- Initial release, extracted from zope.app.applicationcontrol.

Deleted: zope.applicationcontrol/trunk/INSTALL.txt
===================================================================
--- zope.applicationcontrol/trunk/INSTALL.txt	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/INSTALL.txt	2010-01-09 14:12:52 UTC (rev 107926)
@@ -1,81 +0,0 @@
-=======================
-Installing This Package
-=======================
-
-Prerequisites
--------------
-
-The installation steps below assume that you have the cool new 'setuptools'
-package installed in your Python.  Here is where to get it::
-
-  $ wget http://peak.telecommunity.com/dist/ez_setup.py
-  $ /path/to/your/python ez_setup.py # req. write access to 'site-packages'
-
-- Docs for EasyInstall:
-  http://peak.telecommunity.com/DevCenter/EasyInstall
-
-- Docs for setuptools:
-  http://peak.telecommunity.com/DevCenter/setuptools
-
-- Docs for eggs:
-  http://peak.telecommunity.com/DevCenter/PythonEggs
-
-
-Installing a Development Checkout
----------------------------------
-
-Check out the package from subversion::
-
-  $ svn co svn+ssh://svn.zope.org/repos/main/zope.app.applicationcontrol/trunk \
-    src/zope.app.applicationcontrol
-  $ cd src/zope.app.applicationcontrol
-
-Install it as a "devlopment egg" (which also installs its "hard"
-dependencies)::
-
-  $ /path/to/your/python setup.py devel
-
-The installation of dependency eggs uses the 'setup.cfg' file in
-the checkout.  You can supply '--find-links' on the command line to
-point it at a non-standard package repository.
-
-
-Running the Tests
------------------
-
-To test the package, you will also need the 'zope.testing' package, which
-can't (yet) be automatically installed.  Eventually, you should be able to
-type::
-
-  $ /path/to/your/python setup.py test
-
-and have it install the "testing dependencies."  Today, the workaround
-is to install it manually::
-
-  $ /path/to/easy_install --find-links="...." zope.testing
-
-You can then run the tests (finally) from the checkout directory::
-
-  $ /path/to/your/python test.py
-  Running:
-    .............
-  Ran 13 tests with 0 failures and 0 errors in 0.094 seconds.
-
-
-Installing a Source Distribution
---------------------------------
-
-You can also install it from a source distribution::
-
-  $ /path/to/easy_install --find-links="...." -eb src zope.app.applicationcontrol
-  $ cd src/zope.app.applicationcontrol
-  $ /path/to/your/python setup.py devel
-
-
-Installing a Binary Egg
------------------------
-
-Install the package as a "binary egg" (which also installs its "hard"
-dependencies)::
-
-  $ /path/to/easy_install --find-links="...." zope.app.applicationcontrol

Modified: zope.applicationcontrol/trunk/README.txt
===================================================================
--- zope.applicationcontrol/trunk/README.txt	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/README.txt	2010-01-09 14:12:52 UTC (rev 107926)
@@ -1,25 +1,10 @@
-===========================
-zope.app.applicationcontrol
-===========================
+=======================
+zope.applicationcontrol
+=======================
 
-The application control instance is usually generated upon startup.
-This package provides runtime information adapter for application
-control and Zope version.  Also provide a utility with methods for
-shutting down and restarting the server.
+The application control instance can be generated upon startup of an
+application built with the Zope Toolkit.
 
-
-Developer Resources
--------------------
-
-- Subversion browser:
-
-    http://svn.zope.org/zope.app.applicationcontrol/
-
-- Read-only Subversion checkout::
-
-  $ svn co svn://svn.zope.org/repos/main/zope.app.applicationcontrol/trunk
-
-- Writable Subversion checkout::
-
-  $ svn co svn+ssh://userid@svn.zope.org/repos/main/zope.app.applicationcontrol/trunk
-
+This package provides an API to retrieve runtime information. It also
+provides a utility with methods for shutting down and restarting the
+server.

Modified: zope.applicationcontrol/trunk/buildout.cfg
===================================================================
--- zope.applicationcontrol/trunk/buildout.cfg	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/buildout.cfg	2010-01-09 14:12:52 UTC (rev 107926)
@@ -1,8 +1,7 @@
 [buildout]
 develop = . 
 parts = test
-find-links = http://download.zope.org/distribution/
 
 [test]
 recipe = zc.recipe.testrunner
-eggs = zope.app.applicationcontrol [test]
+eggs = zope.applicationcontrol [test]

Modified: zope.applicationcontrol/trunk/setup.py
===================================================================
--- zope.applicationcontrol/trunk/setup.py	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/setup.py	2010-01-09 14:12:52 UTC (rev 107926)
@@ -25,20 +25,18 @@
 def read(*rnames):
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
-setup(name='zope.app.applicationcontrol',
+setup(name='zope.applicationcontrol',
     version = version,
     author='Zope Foundation and Contributors',
-    author_email='zope3-dev at zope.org',
+    author_email='zope-dev at zope.org',
     description='Zope applicationcontrol',
     long_description=(
         read('README.txt')
         + '\n\n' +
-        read('INSTALL.txt')
-        + '\n\n' +
         read('CHANGES.txt')
         ),
     license='ZPL 2.1',
-    keywords = "zope3 application control",
+    keywords = "zope ztk application control",
     classifiers = [
         'Development Status :: 5 - Production/Stable',
         'Environment :: Web Environment',
@@ -49,7 +47,7 @@
         'Operating System :: OS Independent',
         'Topic :: Internet :: WWW/HTTP',
         'Framework :: Zope3'],
-    url='http://cheeseshop.python.org/pypi/zope.app.applicationcontrol',
+    url='http://cheeseshop.python.org/pypi/zope.applicationcontrol',
     extras_require=dict(
         test=['zope.app.appsetup',
               'zope.app.authentication',
@@ -63,7 +61,7 @@
               ]),
     package_dir = {'': 'src'},
     packages=find_packages('src'),
-    namespace_packages=['zope', 'zope.app'],
+    namespace_packages=['zope'],
     install_requires=[
           'setuptools',
           'zope.component',

Modified: zope.applicationcontrol/trunk/src/zope/applicationcontrol/applicationcontrol.py
===================================================================
--- zope.applicationcontrol/trunk/src/zope/app/applicationcontrol/applicationcontrol.py	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/src/zope/applicationcontrol/applicationcontrol.py	2010-01-09 14:12:52 UTC (rev 107926)
@@ -21,7 +21,7 @@
 import zope.traversing.interfaces
 from zope.location import Location
 from zope.security.checker import ProxyFactory, NamesChecker
-from zope.app.applicationcontrol.interfaces import IApplicationControl
+from zope.applicationcontrol.interfaces import IApplicationControl
 
 class ApplicationControl(Location):
 

Modified: zope.applicationcontrol/trunk/src/zope/applicationcontrol/interfaces.py
===================================================================
--- zope.applicationcontrol/trunk/src/zope/app/applicationcontrol/interfaces.py	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/src/zope/applicationcontrol/interfaces.py	2010-01-09 14:12:52 UTC (rev 107926)
@@ -41,10 +41,6 @@
         """Return the name of the encoding used to convert
            Unicode filenames into system file names"""
 
-    def getZopeVersion():
-        """Return a string containing the descriptive version of the
-           current zope installation"""
-
     def getPythonVersion():
         """Return an unicode string containing verbose description
            of the python interpreter"""
@@ -67,14 +63,6 @@
         """Return the Zope server uptime in seconds"""
 
 
-class IZopeVersion(Interface):
-    """ Zope version """
-
-    def getZopeVersion():
-        """Return a string containing the Zope version (possibly including
-           SVN information)"""
-
-
 class IServerControl(Interface):
     """Defines methods for shutting down and restarting the server.
 

Modified: zope.applicationcontrol/trunk/src/zope/applicationcontrol/runtimeinfo.py
===================================================================
--- zope.applicationcontrol/trunk/src/zope/app/applicationcontrol/runtimeinfo.py	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/src/zope/applicationcontrol/runtimeinfo.py	2010-01-09 14:12:52 UTC (rev 107926)
@@ -31,11 +31,10 @@
 from zope.component import getUtility, ComponentLookupError
 from zope.interface import implements
 
-from zope.app.applicationcontrol.i18n import ZopeMessageFactory as _
+from zope.applicationcontrol.i18n import ZopeMessageFactory as _
 
-from zope.app.applicationcontrol.interfaces import IRuntimeInfo
-from zope.app.applicationcontrol.interfaces import IApplicationControl
-from zope.app.applicationcontrol.interfaces import IZopeVersion
+from zope.applicationcontrol.interfaces import IRuntimeInfo
+from zope.applicationcontrol.interfaces import IApplicationControl
 
 try:
     from zope.app.appsetup import appsetup
@@ -80,14 +79,6 @@
             enc = self.getPreferredEncoding()
         return enc
 
-    def getZopeVersion(self):
-        """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
-        try:
-            version_utility = getUtility(IZopeVersion)
-        except ComponentLookupError:
-            return _("Unavailable")
-        return version_utility.getZopeVersion()
-
     def getPythonVersion(self):
         """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
         return unicode(sys.version, self.getPreferredEncoding())

Modified: zope.applicationcontrol/trunk/src/zope/applicationcontrol/tests/test_applicationcontrol.py
===================================================================
--- zope.applicationcontrol/trunk/src/zope/app/applicationcontrol/tests/test_applicationcontrol.py	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/src/zope/applicationcontrol/tests/test_applicationcontrol.py	2010-01-09 14:12:52 UTC (rev 107926)
@@ -18,8 +18,8 @@
 from zope.interface.verify import verifyObject
 
 import time
-from zope.app.applicationcontrol.applicationcontrol import ApplicationControl
-from zope.app.applicationcontrol.interfaces import IApplicationControl
+from zope.applicationcontrol.applicationcontrol import ApplicationControl
+from zope.applicationcontrol.interfaces import IApplicationControl
 
 # seconds, time values may differ in order to be assumed equal
 time_tolerance = 2

Modified: zope.applicationcontrol/trunk/src/zope/applicationcontrol/tests/test_runtimeinfo.py
===================================================================
--- zope.applicationcontrol/trunk/src/zope/app/applicationcontrol/tests/test_runtimeinfo.py	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/src/zope/applicationcontrol/tests/test_runtimeinfo.py	2010-01-09 14:12:52 UTC (rev 107926)
@@ -25,26 +25,18 @@
 import zope.component
 from zope.interface import implements
 from zope.interface.verify import verifyObject
-from zope.app.applicationcontrol.applicationcontrol import applicationController
-from zope.app.applicationcontrol.interfaces import IRuntimeInfo, IZopeVersion
+from zope.applicationcontrol.applicationcontrol import applicationController
+from zope.applicationcontrol.interfaces import IRuntimeInfo
 from zope.app.component.testing import PlacefulSetup
 
 # seconds, time values may differ in order to be assumed equal
 time_tolerance = 2
 stupid_version_string = "3085t0klvn93850voids"
 
-class TestZopeVersion(object):
-    """A fallback implementation for the ZopeVersion utility."""
-
-    implements(IZopeVersion)
-
-    def getZopeVersion(self):
-        return stupid_version_string
-
 class Test(PlacefulSetup, unittest.TestCase):
 
     def _Test__new(self):
-        from zope.app.applicationcontrol.runtimeinfo import RuntimeInfo
+        from zope.applicationcontrol.runtimeinfo import RuntimeInfo
         return RuntimeInfo(applicationController)
 
     def _getPreferredEncoding(self):
@@ -74,17 +66,6 @@
         enc = self._getFileSystemEncoding()
         self.assertEqual(runtime_info.getFileSystemEncoding(), enc)
 
-    def test_ZopeVersion(self):
-        runtime_info = self._Test__new()
-
-        # we expect that there is no utility
-        self.assertEqual(runtime_info.getZopeVersion(), u"Unavailable")
-
-        siteManager = zope.component.getSiteManager()
-        siteManager.registerUtility(TestZopeVersion(), IZopeVersion)
-
-        self.assertEqual(runtime_info.getZopeVersion(), stupid_version_string)
-
     def test_PythonVersion(self):
         runtime_info = self._Test__new()
         enc = self._getPreferredEncoding()

Deleted: zope.applicationcontrol/trunk/src/zope/applicationcontrol/tests/test_zopeversion.py
===================================================================
--- zope.applicationcontrol/trunk/src/zope/app/applicationcontrol/tests/test_zopeversion.py	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/src/zope/applicationcontrol/tests/test_zopeversion.py	2010-01-09 14:12:52 UTC (rev 107926)
@@ -1,142 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 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.
-#
-##############################################################################
-"""Zope Version Tests
-
-$Id$
-"""
-import os
-import shutil
-import subprocess
-import tempfile
-import unittest
-
-from zope.interface.verify import verifyObject
-from zope.app.applicationcontrol.interfaces import IZopeVersion
-from zope.app.applicationcontrol.zopeversion import ZopeVersion
-
-
-def isSVNAvailable():
-    try:
-        proc = subprocess.Popen('svn help', shell=True, stdout=subprocess.PIPE)
-    except OSError:
-        return False
-    else:
-        return proc.wait() == 0
-
-
-def isSVNCheckout(dir):
-    return os.path.isdir(os.path.join(dir, '.svn'))
-
-
-class MockZopeVersion(ZopeVersion):
-
-    def setSVNInfoOutput(self, lines):
-        self.__lines = lines
-
-    def _getSVNInfoOutput(self):
-        return self.__lines
-
-class Test(unittest.TestCase):
-
-    def setUp(self):
-        self.tmpdir = tempfile.mkdtemp(prefix="test-zopeversion-")
-        self.zopeVersion = MockZopeVersion(self.tmpdir)
-
-    def tearDown(self):
-        shutil.rmtree(self.tmpdir)
-
-    def prepare(self, version, fields):
-        if version:
-            f = open(os.path.join(self.tmpdir, "version.txt"), "w")
-            try:
-                f.write(version)
-                if not version.endswith("\n"):
-                    f.write("\n")
-            finally:
-                f.close()
-        if fields:
-            os.mkdir(os.path.join(self.tmpdir, ".svn"))
-            self.zopeVersion.setSVNInfoOutput(fields)
-
-    def test_IVerify(self):
-        verifyObject(IZopeVersion, self.zopeVersion)
-
-    def test_ZopeVersion(self):
-        self.prepare(None, None)
-        self.assertEqual(self.zopeVersion.getZopeVersion(),
-            "Development/Unknown")
-
-    def test_ZopeVersion_svntrunk(self):
-        self.prepare(None, [
-            "URL: svn+ssh://svn.zope.org/repos/main/Zope3/trunk/src/zope",
-            "Revision: 10000"
-            ])
-        self.assertEqual(self.zopeVersion.getZopeVersion(),
-            "Development/Revision: 10000")
-
-    def test_ZopeVersion_svnbranch(self):
-        self.prepare(None, [
-            "URL: svn+ssh://svn.zope.org/repos/main/Zope3/branches/Zope3-1.0/src/zope",
-            "Revision: 10000"
-            ])
-        self.assertEqual(self.zopeVersion.getZopeVersion(),
-            "Development/Revision: 10000/Branch: Zope3-1.0")
-
-    def test_ZopeVersion_svntag(self):
-        self.prepare(None, [
-            "URL: svn+ssh://svn.zope.org/repos/main/Zope3/tags/Zope3-1.0/src/zope",
-            "Revision: 10000"
-            ])
-        self.assertEqual(self.zopeVersion.getZopeVersion(),
-            "Development/Revision: 10000/Tag: Zope3-1.0")
-
-    def test_ZopeVersion_svn_unknown(self):
-        self.prepare(None, ["Nope: "])
-        self.assertEqual(self.zopeVersion.getZopeVersion(),
-            "Development/Unknown")
-
-    def test_ZopeVersion_release(self):
-        self.prepare("Zope 3 1.0.0", None)
-        self.assertEqual(self.zopeVersion.getZopeVersion(),
-            "Zope 3 1.0.0")
-
-    def test_ZopeVersion_release_empty(self):
-        self.prepare(" ", None)
-        self.assertEqual(self.zopeVersion.getZopeVersion(),
-            "Development/Unknown")
-
-    def test_ZopeVersion_release_svntrunk(self):
-        # demonstrate that the version.txt data is discarded if
-        # there's revision-control metadata:
-        self.prepare("Zope 3 1.0.0", [
-            "URL: svn+ssh://svn.zope.org/repos/main/Zope3/trunk/src/zope",
-            "Revision: 10000"
-            ])
-        self.assertEqual(self.zopeVersion.getZopeVersion(),
-            "Development/Revision: 10000")
-
-    def test_WrongLocale(self):
-        """Demonstrate bug 177733"""
-        currentPath = os.path.dirname(os.path.abspath(__file__))
-        if isSVNAvailable() and isSVNCheckout(currentPath):
-            zv = ZopeVersion(currentPath)
-            zv.getZopeVersion()
-            # check that we don't get a 'Development/Unknown' version
-            self.assert_(zv.result.startswith('Development/Revision: '))
-
-def test_suite():
-    return unittest.makeSuite(Test)
-
-if __name__ == '__main__':
-    unittest.main(defaultTest="test_suite")

Deleted: zope.applicationcontrol/trunk/src/zope/applicationcontrol/zopeversion.py
===================================================================
--- zope.applicationcontrol/trunk/src/zope/app/applicationcontrol/zopeversion.py	2010-01-09 13:56:12 UTC (rev 107925)
+++ zope.applicationcontrol/trunk/src/zope/applicationcontrol/zopeversion.py	2010-01-09 14:12:52 UTC (rev 107926)
@@ -1,102 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 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.
-#
-##############################################################################
-"""Utility to retrieve the Zope version.
-
-$Id$
-"""
-__docformat__ = 'restructuredtext'
-
-import os
-import re
-import subprocess
-
-import zope.app
-from zope.app.applicationcontrol.interfaces import IZopeVersion
-from zope.interface import implements
-
-
-class ZopeVersion(object):
-
-    implements(IZopeVersion)
-
-    __tags = re.compile(r'/(tags|branches)/([^/]+)/')
-
-    def __init__(self, path=None):
-        if path is None:
-            path = os.path.dirname(os.path.abspath(zope.app.__file__))
-        self.path = path
-        self.result = None
-
-    def getZopeVersion(self):
-        """See zope.app.applicationcontrol.interfaces.IZopeVersion"""
-        if self.result is not None:
-            return self.result
-
-        self.result = "Development/Unknown"
-
-        # is this a SVN checkout?
-        svndir = os.path.join(self.path, ".svn")
-        if os.path.isdir(svndir):
-            self.__setSVNVersion(svndir)
-        else:
-            # try to get official Zope release information
-            versionfile = os.path.join(self.path, "version.txt")
-            if os.path.isfile(versionfile):
-                f = file(versionfile)
-                try:
-                    self.result = f.readline().strip() or self.result
-                finally:
-                    f.close()
-        return self.result
-
-    def _getSVNInfoOutput(self):
-        try:
-            proc = subprocess.Popen('svn info "%s"' % self.path,
-                shell=True, stdout=subprocess.PIPE, env={'LANG': 'C'})
-        except OSError:
-            pass
-        else:
-            if proc.wait() == 0:
-                return proc.stdout
-        return None
-
-    def __setSVNVersion(self, svndir):
-        output = self._getSVNInfoOutput()
-        if not output:
-            return
-
-        info = {}
-        for line in output:
-            parts = line.rstrip().split(": ", 1)
-            if len(parts) == 2:
-                key, value = parts
-                info[key] = value
-
-        revision = info.get("Revision", "")
-        url = info.get("URL", "")
-
-        if revision and url:
-            match = self.__tags.search(url)
-            if match is None:
-                tag = ""
-            else:
-                type, value = match.groups()
-                if type == "tags":
-                    tag = "/Tag: %s" % value
-                elif type == "branches":
-                    tag = "/Branch: %s" % value
-            self.result = ("Development/Revision: %s%s"
-                          % (revision, tag))
-
-ZopeVersionUtility = ZopeVersion()



More information about the checkins mailing list