[Erp5-report] r40284 kazuhiko - in /erp5/trunk/utils/erp5.conflictresolver: ./ Products/ Pr...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Nov 15 18:30:33 CET 2010
Author: kazuhiko
Date: Mon Nov 15 18:30:30 2010
New Revision: 40284
URL: http://svn.erp5.org?rev=40284&view=rev
Log:
initial commit to public repository.
Added:
erp5/trunk/utils/erp5.conflictresolver/
erp5/trunk/utils/erp5.conflictresolver/CHANGES.txt (with props)
erp5/trunk/utils/erp5.conflictresolver/Products/
erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/
erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Selection.py
erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Tool/
erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Tool/SelectionTool.py
erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/__init__.py
erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Type/
erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Type/Utils.py
erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Type/__init__.py
erp5/trunk/utils/erp5.conflictresolver/Products/__init__.py
erp5/trunk/utils/erp5.conflictresolver/README.txt (with props)
erp5/trunk/utils/erp5.conflictresolver/setup.py
Added: erp5/trunk/utils/erp5.conflictresolver/CHANGES.txt
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.conflictresolver/CHANGES.txt?rev=40284&view=auto
==============================================================================
--- erp5/trunk/utils/erp5.conflictresolver/CHANGES.txt (added)
+++ erp5/trunk/utils/erp5.conflictresolver/CHANGES.txt [utf8] Mon Nov 15 18:30:30 2010
@@ -0,0 +1,21 @@
+Changelog
+=========
+
+0.3 (2010-11-15)
+----------------
+
+ - Fix a problem that Products directories are not installed properly.
+ [kazuhiko]
+
+0.2 (2010-06-23)
+----------------
+
+ - It provides Products.ERP5Form.Selection.Selection and
+ Products.ERP5Torm.Tool.SelectionTool.SelectionPersistentMapping.
+ [kazuhiko]
+
+0.1 (2010-06-19)
+----------------
+
+ - Intial version. It provides Products.ERP5Type.Utils.ScalarMaxConflictResolver.
+ [kazuhiko]
Propchange: erp5/trunk/utils/erp5.conflictresolver/CHANGES.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Selection.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Selection.py?rev=40284&view=auto
==============================================================================
--- erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Selection.py (added)
+++ erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Selection.py [utf8] Mon Nov 15 18:30:30 2010
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility 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
+# guarantees 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.
+#
+##############################################################################
+
+from Persistence import Persistent, PersistentMapping
+
+class Selection(Persistent):
+ def _p_independent(self) :
+ return 1
+
+ def _p_resolveConflict(self, oldState, savedState, newState) :
+ """Selection are edited by listboxs, so many conflicts can happen,
+ this is a workaround, so that no unnecessary transaction is
+ restarted."""
+ return newState
Added: erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Tool/SelectionTool.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Tool/SelectionTool.py?rev=40284&view=auto
==============================================================================
--- erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Tool/SelectionTool.py (added)
+++ erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/Tool/SelectionTool.py [utf8] Mon Nov 15 18:30:30 2010
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility 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
+# guarantees 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.
+#
+##############################################################################
+
+from Persistence import Persistent, PersistentMapping
+
+class SelectionPersistentMapping(PersistentMapping):
+ """A conflict-free PersistentMapping.
+
+ Like selection objects, the purpose is to only prevent restarting
+ transactions.
+ """
+ def _p_independent(self) :
+ return 1
+
+ def _p_resolveConflict(self, oldState, savedState, newState):
+ # update keys that only savedState has
+ oldState = newState
+ # dict returned by PersistentMapping.__getstate__ contains the data
+ # under '_container' key in zope 2.7 and 'data' in zope 2.8
+ if 'data' in oldState:
+ oldState['data'].update(savedState['data'])
+ else:
+ oldState['_container'].update(savedState['_container'])
+ return oldState
Added: erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/__init__.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Form/__init__.py?rev=40284&view=auto
==============================================================================
(empty)
Added: erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Type/Utils.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Type/Utils.py?rev=40284&view=auto
==============================================================================
--- erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Type/Utils.py (added)
+++ erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Type/Utils.py [utf8] Mon Nov 15 18:30:30 2010
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility 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
+# guarantees 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.
+#
+##############################################################################
+
+import persistent
+
+class ScalarMaxConflictResolver(persistent.Persistent):
+ """
+ Store the last id generated
+ The object support application-level conflict resolution
+ """
+
+ def __init__(self, value=0):
+ self.value = value
+
+ def __getstate__(self):
+ return self.value
+
+ def __setstate__(self, value):
+ self.value = value
+
+ def set(self, value):
+ self.value = value
+
+ def _p_resolveConflict(self, old, first_id, second_id):
+ return max(first_id, second_id)
+
+ def _p_independent(self):
+ # My state doesn't depend on or materially effect the state of
+ # other objects.
+ return 1
Added: erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Type/__init__.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.conflictresolver/Products/ERP5Type/__init__.py?rev=40284&view=auto
==============================================================================
(empty)
Added: erp5/trunk/utils/erp5.conflictresolver/Products/__init__.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.conflictresolver/Products/__init__.py?rev=40284&view=auto
==============================================================================
--- erp5/trunk/utils/erp5.conflictresolver/Products/__init__.py (added)
+++ erp5/trunk/utils/erp5.conflictresolver/Products/__init__.py [utf8] Mon Nov 15 18:30:30 2010
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
Added: erp5/trunk/utils/erp5.conflictresolver/README.txt
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.conflictresolver/README.txt?rev=40284&view=auto
==============================================================================
--- erp5/trunk/utils/erp5.conflictresolver/README.txt (added)
+++ erp5/trunk/utils/erp5.conflictresolver/README.txt [utf8] Mon Nov 15 18:30:30 2010
@@ -0,0 +1,2 @@
+This library contains custom conflict solvers for ERP5. It is useful for ZEO
+server.
Propchange: erp5/trunk/utils/erp5.conflictresolver/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: erp5/trunk/utils/erp5.conflictresolver/setup.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.conflictresolver/setup.py?rev=40284&view=auto
==============================================================================
--- erp5/trunk/utils/erp5.conflictresolver/setup.py (added)
+++ erp5/trunk/utils/erp5.conflictresolver/setup.py [utf8] Mon Nov 15 18:30:30 2010
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+from setuptools import setup, find_packages
+
+name = 'erp5.conflictresolver'
+version = '0.2'
+
+def read(name):
+ return open(name).read()
+
+long_description=(
+ '\n' + read('README.txt') + '\n' + read('CHANGES.txt')
+ )
+
+setup(
+ name = name,
+ version = version,
+ url = 'http://www.erp5.org/',
+ author = 'Kazuhiko Shiozaki',
+ author_email = 'kazuhiko at nexedi.com',
+ description = 'Custom conflict resolvers for ERP5 that is useful for ZEO server',
+ long_description=long_description,
+ license = 'GPL',
+ keywords = 'zeo zope2 erp5',
+ classifiers=[
+ 'License :: OSI Approved :: GNU General Public License (GPL)',
+ 'Framework :: Zope2',
+ ],
+ packages=find_packages(exclude=['ez_setup']),
+ namespace_packages=['Products'],
+ include_package_data=True,
+ zip_safe=False,
+ )
More information about the Erp5-report
mailing list