[Zope-Checkins] SVN: Zope/trunk/ Removed more unused code of the versions support feature including the Globals.VersionNameName constant.

Hanno Schlichting plone at hannosch.info
Sun Apr 19 12:38:25 EDT 2009


Log message for revision 99285:
  Removed more unused code of the versions support feature including the Globals.VersionNameName constant.
  

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  U   Zope/trunk/src/App/ZApplication.py
  U   Zope/trunk/src/Globals/__init__.py
  U   Zope/trunk/src/OFS/tests/testAppInitializer.py
  U   Zope/trunk/src/OFS/tests/testProductInit.py
  U   Zope/trunk/src/Zope2/App/startup.py

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst	2009-04-19 15:58:40 UTC (rev 99284)
+++ Zope/trunk/doc/CHANGES.rst	2009-04-19 16:38:24 UTC (rev 99285)
@@ -9,9 +9,6 @@
 Trunk
 -----
 
-2.12.0a2 (2009-04-19)
----------------------
-
 Known issues
 ++++++++++++
 
@@ -21,14 +18,24 @@
 
 - ZODB 3.9.0a12 does not work on Windows with Python 2.6 yet.
 
-- There is no old-style full tarball release that resembles the prior
-  releases of Zope at this point.
-
 - easy_install support not fully functional yet.
 
 Restructuring
 +++++++++++++
 
+- Removed more unused code of the versions support feature including the
+  Globals.VersionNameName constant.
+
+Bugs Fixed
+++++++++++
+
+
+2.12.0a2 (2009-04-19)
+---------------------
+
+Restructuring
++++++++++++++
+
 - If the <permission /> ZCML directive is used to declare a permission that
   does not exist, the permission will now be created automatically, defaulting
   to being granted to the Manager role only. This means it is possible to

Modified: Zope/trunk/src/App/ZApplication.py
===================================================================
--- Zope/trunk/src/App/ZApplication.py	2009-04-19 15:58:40 UTC (rev 99284)
+++ Zope/trunk/src/App/ZApplication.py	2009-04-19 16:38:24 UTC (rev 99285)
@@ -23,9 +23,8 @@
 
 class ZApplicationWrapper:
 
-    def __init__(self, db, name, klass= None, klass_args= (),
-                 version_cookie_name=None):
-        self._stuff = db, name, version_cookie_name
+    def __init__(self, db, name, klass= None, klass_args=()):
+        self._stuff = db, name
         if klass is not None:
             conn=db.open()
             root=conn.root()
@@ -35,21 +34,12 @@
             conn.close()
             self._klass=klass
 
-
     # This hack is to overcome a bug in Bobo!
     def __getattr__(self, name):
         return getattr(self._klass, name)
 
     def __bobo_traverse__(self, REQUEST=None, name=None):
-        db, aname, version_support = self._stuff
-        if version_support is not None and REQUEST is not None:
-            version=REQUEST.get(version_support,'')
-        else: version=''
-    
-#        conn=db.open(version)
-        # 'version' argument no longer support with ZODB 3.9.
-        # The cruft for version_support can likely be removed!?
-        # (ajung, 2009/01/26)
+        db, aname = self._stuff
         conn = db.open()
 
         if connection_open_hooks:
@@ -75,7 +65,7 @@
 
 
     def __call__(self, connection=None):
-        db, aname, version_support = self._stuff
+        db, aname = self._stuff
 
         if connection is None:
             connection=db.open()

Modified: Zope/trunk/src/Globals/__init__.py
===================================================================
--- Zope/trunk/src/Globals/__init__.py	2009-04-19 15:58:40 UTC (rev 99284)
+++ Zope/trunk/src/Globals/__init__.py	2009-04-19 16:38:24 UTC (rev 99285)
@@ -66,9 +66,6 @@
 del deprecated
 
 DevelopmentMode = False
-VersionNameName='Zope-Version'
 
 # XXX ZODB stashes the main database object here
 opened = []
-
-

Modified: Zope/trunk/src/OFS/tests/testAppInitializer.py
===================================================================
--- Zope/trunk/src/OFS/tests/testAppInitializer.py	2009-04-19 15:58:40 UTC (rev 99284)
+++ Zope/trunk/src/OFS/tests/testAppInitializer.py	2009-04-19 16:38:24 UTC (rev 99285)
@@ -12,12 +12,11 @@
 #
 ##############################################################################
 
-import os, sys, unittest, tempfile, cStringIO
+import os, unittest, tempfile, cStringIO
 
 from logging import getLogger
 
-import ZODB
-from OFS.Application import Application, AppInitializer, get_products
+from OFS.Application import Application, AppInitializer
 import Zope2.Startup
 import ZConfig
 from App.config import getConfiguration, setConfiguration
@@ -55,7 +54,7 @@
 def getApp():
     from App.ZApplication import ZApplicationWrapper
     DB = getConfiguration().dbtab.getDatabase('/')
-    return ZApplicationWrapper(DB, 'Application', Application, (), 'foo')()
+    return ZApplicationWrapper(DB, 'Application', Application, ())()
 
 original_config = None
 

Modified: Zope/trunk/src/OFS/tests/testProductInit.py
===================================================================
--- Zope/trunk/src/OFS/tests/testProductInit.py	2009-04-19 15:58:40 UTC (rev 99284)
+++ Zope/trunk/src/OFS/tests/testProductInit.py	2009-04-19 16:38:24 UTC (rev 99285)
@@ -12,10 +12,9 @@
 #
 ##############################################################################
 
-import os, sys, unittest, tempfile, shutil, cStringIO
+import os, unittest, tempfile, shutil, cStringIO
 
-import ZODB
-from OFS.Application import Application, AppInitializer, get_products
+from OFS.Application import Application
 import Zope2.Startup
 import ZConfig
 from App.config import getConfiguration, setConfiguration
@@ -66,7 +65,7 @@
 def getApp():
     from App.ZApplication import ZApplicationWrapper
     DB = getConfiguration().dbtab.getDatabase('/')
-    return ZApplicationWrapper(DB, 'Application', Application, (), 'foo')()
+    return ZApplicationWrapper(DB, 'Application', Application, ())()
 
 original_config = None
 

Modified: Zope/trunk/src/Zope2/App/startup.py
===================================================================
--- Zope/trunk/src/Zope2/App/startup.py	2009-04-19 15:58:40 UTC (rev 99284)
+++ Zope/trunk/src/Zope2/App/startup.py	2009-04-19 16:38:24 UTC (rev 99285)
@@ -14,7 +14,6 @@
 """
 
 from zope.component import queryMultiAdapter
-from AccessControl.SecurityManagement import getSecurityManager
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.SecurityManagement import noSecurityManager
 from Acquisition import aq_acquire
@@ -24,7 +23,7 @@
 from App.config import getConfiguration
 from time import asctime
 from types import StringType, ListType
-from zExceptions import Unauthorized, Redirect
+from zExceptions import Redirect
 from ZODB.POSException import ConflictError
 import transaction
 import AccessControl.User
@@ -33,7 +32,6 @@
 import imp
 import logging
 import OFS.Application
-import os
 import sys
 import ZODB
 import App.ZApplication
@@ -108,8 +106,8 @@
     # Set up the "app" object that automagically opens
     # connections
     app = App.ZApplication.ZApplicationWrapper(
-        DB, 'Application', OFS.Application.Application, (),
-        Globals.VersionNameName)
+        DB, 'Application', OFS.Application.Application, ()
+    )
     Zope2.bobo_application = app
 
     # Initialize the app object
@@ -134,20 +132,7 @@
 
 
 def validated_hook(request, user):
-    import Globals # to fetch data
     newSecurityManager(request, user)
-    version = request.get(Globals.VersionNameName, '')
-    if version:
-        object = aq_parent(user)
-        if not getSecurityManager().checkPermission(
-            'Join/leave Versions', object):
-            request['RESPONSE'].setCookie(
-                Globals.VersionNameName,'No longer active',
-                expires="Mon, 25-Jan-1999 23:59:59 GMT",
-                path=(request['BASEPATH1'] or '/'),
-                )
-            Zope2.DB.removeVersionPool(version)
-            raise Unauthorized, "You don't have permission to enter versions."
 
 
 class RequestContainer(ExtensionClass.Base):



More information about the Zope-Checkins mailing list