[Erp5-report] r25552 - in /erp5/trunk/products/ERP5Type: ./ patches/
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Feb 12 20:43:58 CET 2009
Author: kazuhiko
Date: Thu Feb 12 20:43:57 2009
New Revision: 25552
URL: http://svn.erp5.org?rev=25552&view=rev
Log:
these patches are no longer required because Zope 2.7 is no longer supported.
Removed:
erp5/trunk/products/ERP5Type/patches/Connection.py
erp5/trunk/products/ERP5Type/patches/PersistencePatch.py
erp5/trunk/products/ERP5Type/patches/Transaction.py
erp5/trunk/products/ERP5Type/patches/copy_reg_patch.py
erp5/trunk/products/ERP5Type/patches/persistent_patch.py
Modified:
erp5/trunk/products/ERP5Type/ZopePatch.py
Modified: erp5/trunk/products/ERP5Type/ZopePatch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/ZopePatch.py?rev=25552&r1=25551&r2=25552&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/ZopePatch.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/ZopePatch.py [utf8] Thu Feb 12 20:43:57 2009
@@ -25,7 +25,6 @@
from Products.ERP5Type.patches import DA
from Products.ERP5Type.patches import DCWorkflow
from Products.ERP5Type.patches import BTreeFolder2
-from Products.ERP5Type.patches import Transaction
from Products.ERP5Type.patches import WorkflowTool
from Products.ERP5Type.patches import XMLExportImport
from Products.ERP5Type.patches import ppml
@@ -47,14 +46,10 @@
from Products.ERP5Type.patches import CMFCoreSkinsTool
from Products.ERP5Type.patches import CMFBTreeFolder
from Products.ERP5Type.patches import OFSFolder
-from Products.ERP5Type.patches import Connection
-from Products.ERP5Type.patches import copy_reg_patch
-from Products.ERP5Type.patches import PersistencePatch
from Products.ERP5Type.patches import PersistentMapping
from Products.ERP5Type.patches import DateTimePatch
from Products.ERP5Type.patches import PythonScript
from Products.ERP5Type.patches import MailTemplates
-from Products.ERP5Type.patches import persistent_patch
from Products.ERP5Type.patches import http_server
# These symbols are required for backward compatibility
Removed: erp5/trunk/products/ERP5Type/patches/Connection.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/Connection.py?rev=25551&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/Connection.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/Connection.py (removed)
@@ -1,74 +1,0 @@
-##############################################################################
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# Copyright (c) 2007 Nexedi SA
-# 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
-#
-##############################################################################
-
-"""This patch is for importing Business Templates generated by Zope 2.8
-into Zope 2.7.
-
-In Zope 2.7, the class of an object was represented by a tuple (module, name),
-but this has been changed to just a class name itself.
-"""
-
-try:
- # This portion depends on ZODB, so the version test is based on
- # the ZODB's structure. In ZODB 3.4 and later, the object serialization
- # is segregated to serialize.py, while it is in Connection.py in ZODB 3.2.
- from ZODB import serialize
- del serialize
-except ImportError:
- from ZODB.Connection import Connection, StringIO, Unpickler, ExtensionKlass
-
- def __getitem__(self, oid, tt=type(())):
- obj = self._cache.get(oid, None)
- if obj is not None:
- return obj
-
- __traceback_info__ = (oid)
- p, serial = self._storage.load(oid, self._version)
- __traceback_info__ = (oid, p)
- file=StringIO(p)
- unpickler=Unpickler(file)
- unpickler.persistent_load=self._persistent_load
-
- object = unpickler.load()
-
- # <patch author="yo">
- if type(object) is tt:
- klass, args = object
- else:
- klass = object
- args = None
- # </patch>
-
- if type(klass) is tt:
- module, name = klass
- klass=self._db._classFactory(self, module, name)
-
- if (args is None or
- not args and not hasattr(klass,'__getinitargs__')):
- object=klass.__basicnew__()
- else:
- object = klass(*args)
- if klass is not ExtensionKlass:
- object.__dict__.clear()
-
- object._p_oid=oid
- object._p_jar=self
- object._p_changed=None
- object._p_serial=serial
-
- self._cache[oid] = object
- return object
-
- Connection.__getitem__ = __getitem__
Removed: erp5/trunk/products/ERP5Type/patches/PersistencePatch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/PersistencePatch.py?rev=25551&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/PersistencePatch.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/PersistencePatch.py (removed)
@@ -1,39 +1,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Nexedi SARL and Contributors. All Rights Reserved.
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-# Add compatibility for importing business template generated from
-# Zope 2.8 in Zope 2.7
-try:
- from Persistence import mapping
-except ImportError:
- import Persistence
- from PersistentMapping import PersistentMapping
- import imp
- import sys
- Persistence.mapping = imp.new_module('Persistence.mapping')
- sys.modules['Persistence.mapping'] = Persistence.mapping
- Persistence.mapping.PersistentMapping = PersistentMapping
Removed: erp5/trunk/products/ERP5Type/patches/Transaction.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/Transaction.py?rev=25551&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/Transaction.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/Transaction.py (removed)
@@ -1,54 +1,0 @@
-############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# Copyright (c) 2002,2005,2007 Nexedi SA 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.
-#
-############################################################################
-
-# Add beforeCommitHook into Transaction under Zope 2.7. This API is compatible
-# with Zope 2.8.
-try:
- from ZODB.Transaction import Transaction
-
- super__commit = Transaction.commit
- super__init = Transaction.__init__
-
- def __init__(self, *args, **kw):
- super__init(self, *args, **kw)
- self._before_commit = []
-
- def commit(self, subtransaction=None):
- """Finalize the transaction."""
- if not subtransaction:
- self._callBeforeCommitHooks()
-
- return super__commit(self, subtransaction=subtransaction)
-
- def beforeCommitHook(self, hook, *args, **kws):
- self._before_commit.append((hook, args, kws))
-
- def _callBeforeCommitHooks(self):
- # Call all hooks registered, allowing further registrations
- # during processing.
- while self._before_commit:
- hook, args, kws = self._before_commit.pop(0)
- hook(*args, **kws)
-
- from new import instancemethod
- Transaction.__init__ = instancemethod(__init__, None, Transaction)
- Transaction.commit = instancemethod(commit, None, Transaction)
- Transaction.beforeCommitHook = instancemethod(beforeCommitHook, None,
- Transaction)
- Transaction._callBeforeCommitHooks = instancemethod(_callBeforeCommitHooks,
- None, Transaction)
-except ImportError:
- # On Zope 2.8, do not patch Transaction.
- pass
Removed: erp5/trunk/products/ERP5Type/patches/copy_reg_patch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/copy_reg_patch.py?rev=25551&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/copy_reg_patch.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/copy_reg_patch.py (removed)
@@ -1,62 +1,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Nexedi SA and Contributors. All Rights Reserved.
-# Yoshinori Okuji <yo at nexedi.com>
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-"""This is another patch for importing Business Templates generated by Zope 2.8
-into Zope 2.7. Also, look at Connection.py for the other part.
-
-In Zope 2.8 (i.e. ZODB 3.4), persistent objects are based on new-style class,
-while Zope 2.7 (i.e. ZODB 3.2) uses old-style class only. To instantiate
-objects in ZODB 3.4 and later, copy_reg.__newobj__ is utilized, which
-supports only new-style class. On the other hand, ZODB 3.2 makes an empty
-object by calling the class object with None.
-
-However, this is based on the analysis of some observation, and theoretically
-not very certain. There might be an occasion where non-None arguments are
-used to instantiate a ghost object. I am not sure. If this is not true,
-we must patch __newobj__ differently.
-
-Note that this file is named copy_reg_patch instead of copy_reg by intention.
-Otherwise, importing copy_reg results in importing itself. SO DO NOT RENAME
-THIS FILE TO copy_reg.py.
-"""
-
-try:
- from ZODB import serialize
- del serialize
-except ImportError:
- import copy_reg
-
- original_newobj = copy_reg.__newobj__
- def __newobj__(cls, *args):
- # If this method is used for new-style class, call the original.
- # Otherwise, just call the class object with None.
- if issubclass(cls, object):
- return original_newobj(cls, *args)
- return cls(None)
-
- copy_reg.__newobj__ = __newobj__
Removed: erp5/trunk/products/ERP5Type/patches/persistent_patch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/persistent_patch.py?rev=25551&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/persistent_patch.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/persistent_patch.py (removed)
@@ -1,39 +1,0 @@
-##############################################################################
-#
-# Copyright (c) 2008 Nexedi SA and Contributors. All Rights Reserved.
-# TAHARA Yusei <yusei at nexedi.com>
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-# This patch provides forward compatibility between 2.7 and 2.8.
-try:
- import persistent
-except ImportError:
- import sys
- import types
- from ZODB import PersistentList
- persistent = types.ModuleType('persistent')
- persistent.list = PersistentList
- sys.modules['persistent'] = persistent
- sys.modules['persistent.list'] = persistent.list
More information about the Erp5-report
mailing list