Commit e6558614 authored by Tres Seaver's avatar Tres Seaver

Backported r91724 from the trunk:

- Moved exception MountedStorageError from ZODB.POSExceptions
  to Products.TemporaryFolder.mount (now its only client).

- LP #253362:  Moved Zope2-specific module, ZODB/Mount.py, to
  Products/TemporaryFolder/mount.py (its only client is
  Products/TemporaryFolder/TemporaryFolder.py).

- Removed spurious import-time dependencies from
  Products/ZODBMountPoint/MountedObject.py.
parents 69140e0c f82c774f
......@@ -4,6 +4,20 @@ Zope Changes
Change information for previous versions of Zope can be found in the
file HISTORY.txt.
After Zope 2.11.3
Restructuring
- Moved exception MountedStorageError from ZODB.POSExceptions
to Products.TemporaryFolder.mount (now its only client).
- LP #253362: Moved Zope2-specific module, ZODB/Mount.py, to
Products/TemporaryFolder/mount.py (its only client is
Products/TemporaryFolder/TemporaryFolder.py).
- Removed spurious import-time dependencies from
Products/ZODBMountPoint/MountedObject.py.
Zope 2.11.3 (2009/05/04)
Features added
......
......@@ -10,8 +10,7 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""
Mounted database support
""" Mounted database support
A MountedTemporaryFolder is an object that is a mount point. It mounts a
TemporaryStorage-backed database and masquerades as its root object.
......@@ -20,23 +19,20 @@ point object is called, and that returns a Folder object that actually
lives in another ZODB.
To understand this fully, you'll need to read the source of
ZODB.Mount.MountPoint.
Products.TemporaryFolder.mount.MountPoint.
$Id$
"""
__version__='$Revision: 1.12 $'[11:-2]
import os, os.path
import Globals
from Globals import HTMLFile
from ZODB.Mount import MountPoint
from App.special_dtml import DTMLFile
from App.special_dtml import HTMLFile
from OFS.Folder import Folder
from OFS.SimpleItem import Item
from ZODB.DB import DB
from tempstorage.TemporaryStorage import TemporaryStorage
from LowConflictConnection import LowConflictConnection
from ZODB.DB import DB
from Products.TemporaryFolder.mount import MountPoint
ADD_TEMPORARY_FOLDER_PERM="Add Temporary Folder"
......@@ -48,14 +44,15 @@ def constructTemporaryFolder(self, id, title=None, REQUEST=None):
if REQUEST is not None:
return self.manage_main(self, REQUEST, update_menu=1)
constructTemporaryFolderForm=HTMLFile('dtml/addTemporaryFolder', globals())
class SimpleTemporaryContainer(Folder):
# dbtab-style container class
meta_type = 'Temporary Folder'
icon = 'misc_/TemporaryFolder/tempfolder.gif'
class MountedTemporaryFolder(MountPoint, Item):
"""
A mounted RAM database with a basic interface for displaying the
......@@ -73,7 +70,7 @@ class MountedTemporaryFolder(MountPoint, Item):
self.title = title
MountPoint.__init__(self, path='/') # Eep
manage_traceback = Globals.DTMLFile('dtml/mountfail', globals())
manage_traceback = DTMLFile('dtml/mountfail', globals())
def _createDB(self, db=None): # huh? db=db was original
""" Create a mounted RAM database """
......
This diff is collapsed.
......@@ -24,14 +24,15 @@ from logging import getLogger
import transaction
import Globals
import Acquisition
from Acquisition import aq_base, aq_inner, aq_parent
from App.class_init import default__class_init__ as InitializeClass
from Acquisition import ImplicitAcquisitionWrapper
from Acquisition import aq_base
from Acquisition import aq_inner
from Acquisition import aq_parent
from AccessControl.ZopeGuards import guarded_getattr
from OFS.SimpleItem import SimpleItem
from OFS.Folder import Folder
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from ZODB.POSException import MountedStorageError, ConnectionStateError
LOG = getLogger('Zope.ZODBMountPoint')
......@@ -215,11 +216,6 @@ class MountedObject(SimpleItem):
def _logConnectException(self):
'''Records info about the exception that just occurred.
'''
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
import traceback
exc = sys.exc_info()
LOG.error('Failed to mount database. %s (%s)' % exc[:2], exc_info=exc)
f=StringIO()
......@@ -234,7 +230,7 @@ class MountedObject(SimpleItem):
try:
return self._getOrOpenObject(parent)
except:
return Acquisition.ImplicitAcquisitionWrapper(self, parent)
return ImplicitAcquisitionWrapper(self, parent)
def _test(self, parent):
......@@ -279,7 +275,7 @@ class MountedObject(SimpleItem):
return "%s(id=%s)" % (self.__class__.__name__, repr(self.id))
Globals.InitializeClass(MountedObject)
InitializeClass(MountedObject)
def getMountPoint(ob):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment