r622 - in zope-cmfformcontroller/branches/upstream/current: . Actions Extensions exportimport tests

Fabio Tranchitella kobold at alioth.debian.org
Fri Feb 9 14:49:09 CET 2007


Author: kobold
Date: 2007-02-09 14:49:09 +0100 (Fri, 09 Feb 2007)
New Revision: 622

Removed:
   zope-cmfformcontroller/branches/upstream/current/._HISTORY.txt
   zope-cmfformcontroller/branches/upstream/current/._version.txt
Modified:
   zope-cmfformcontroller/branches/upstream/current/Actions/BaseFormAction.py
   zope-cmfformcontroller/branches/upstream/current/Actions/IFormAction.py
   zope-cmfformcontroller/branches/upstream/current/Actions/RedirectTo.py
   zope-cmfformcontroller/branches/upstream/current/Actions/RedirectToAction.py
   zope-cmfformcontroller/branches/upstream/current/Actions/TraverseTo.py
   zope-cmfformcontroller/branches/upstream/current/Actions/TraverseToAction.py
   zope-cmfformcontroller/branches/upstream/current/Actions/__init__.py
   zope-cmfformcontroller/branches/upstream/current/BaseControllerPageTemplate.py
   zope-cmfformcontroller/branches/upstream/current/ControllerBase.py
   zope-cmfformcontroller/branches/upstream/current/ControllerPageTemplate.py
   zope-cmfformcontroller/branches/upstream/current/ControllerPageTemplateFile.py
   zope-cmfformcontroller/branches/upstream/current/ControllerPythonScript.py
   zope-cmfformcontroller/branches/upstream/current/ControllerState.py
   zope-cmfformcontroller/branches/upstream/current/ControllerValidator.py
   zope-cmfformcontroller/branches/upstream/current/Extensions/Install.py
   zope-cmfformcontroller/branches/upstream/current/FSControllerPageTemplate.py
   zope-cmfformcontroller/branches/upstream/current/FSControllerPythonScript.py
   zope-cmfformcontroller/branches/upstream/current/FSControllerValidator.py
   zope-cmfformcontroller/branches/upstream/current/FormAction.py
   zope-cmfformcontroller/branches/upstream/current/FormController.py
   zope-cmfformcontroller/branches/upstream/current/FormValidator.py
   zope-cmfformcontroller/branches/upstream/current/HISTORY.txt
   zope-cmfformcontroller/branches/upstream/current/Script.py
   zope-cmfformcontroller/branches/upstream/current/__init__.py
   zope-cmfformcontroller/branches/upstream/current/exportimport/formcontroller.py
   zope-cmfformcontroller/branches/upstream/current/tests/testCopyRename.py
   zope-cmfformcontroller/branches/upstream/current/tests/test_exportimport.py
   zope-cmfformcontroller/branches/upstream/current/utils.py
   zope-cmfformcontroller/branches/upstream/current/version.txt
Log:
[svn-upgrade] Integrating new upstream version, zope-cmfformcontroller (2.0.6)

Deleted: zope-cmfformcontroller/branches/upstream/current/._HISTORY.txt
===================================================================
(Binary files differ)

Deleted: zope-cmfformcontroller/branches/upstream/current/._version.txt
===================================================================
(Binary files differ)

Modified: zope-cmfformcontroller/branches/upstream/current/Actions/BaseFormAction.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/Actions/BaseFormAction.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/Actions/BaseFormAction.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -7,7 +7,6 @@
 from Products.PageTemplates.Expressions import SecureModuleImporter
 
 from Products.CMFCore.utils import getToolByName
-from Products.CMFFormController.FormController import registerFormAction
 from Products.CMFFormController.utils import log
 from IFormAction import IFormAction
 from ZTUtils.Zope import make_query
@@ -83,7 +82,6 @@
         """Utility method that takes a URL, parses its existing query string,
         and combines the resulting dict with kwargs"""
         import urlparse
-        import urllib
         import cgi
 
         # parse the existing URL

Modified: zope-cmfformcontroller/branches/upstream/current/Actions/IFormAction.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/Actions/IFormAction.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/Actions/IFormAction.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,9 +1,8 @@
-# ###########################################################################
 from Interface import Base
 
 class IFormAction(Base):
+
     def __call__(self, controller_state, REQUEST):
-        """Executes the action.  Returns either a new
-        controller_state or something that should be handed off to
-        the publication machinery."""
-# ###########################################################################
+        """Executes the action. Returns either a new controller_state or
+           something that should be handed off to the publication machinery.
+        """

Modified: zope-cmfformcontroller/branches/upstream/current/Actions/RedirectTo.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/Actions/RedirectTo.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/Actions/RedirectTo.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,4 +1,5 @@
-from BaseFormAction import BaseFormAction, registerFormAction
+from BaseFormAction import BaseFormAction
+from Products.CMFFormController.FormController import registerFormAction
 from urlparse import urlparse, urljoin
 
 def factory(arg):

Modified: zope-cmfformcontroller/branches/upstream/current/Actions/RedirectToAction.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/Actions/RedirectToAction.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/Actions/RedirectToAction.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,6 +1,8 @@
-from BaseFormAction import BaseFormAction, registerFormAction
+from BaseFormAction import BaseFormAction
 import RedirectTo
+
 from Products.CMFCore.utils import getToolByName
+from Products.CMFFormController.FormController import registerFormAction
 
 def factory(arg):
     """Create a new redirect-to-action action"""

Modified: zope-cmfformcontroller/branches/upstream/current/Actions/TraverseTo.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/Actions/TraverseTo.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/Actions/TraverseTo.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,4 +1,6 @@
-from BaseFormAction import BaseFormAction, registerFormAction
+from BaseFormAction import BaseFormAction
+
+from Products.CMFFormController.FormController import registerFormAction
 from ZPublisher.Publish import call_object, missing_name, dont_publish_class
 from ZPublisher.mapply import mapply
 import urlparse

Modified: zope-cmfformcontroller/branches/upstream/current/Actions/TraverseToAction.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/Actions/TraverseToAction.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/Actions/TraverseToAction.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,6 +1,8 @@
-from BaseFormAction import BaseFormAction, registerFormAction
+from BaseFormAction import BaseFormAction
 import TraverseTo
+
 from Products.CMFCore.utils import getToolByName
+from Products.CMFFormController.FormController import registerFormAction
 from urlparse import urlsplit
 
 def factory(arg):

Modified: zope-cmfformcontroller/branches/upstream/current/Actions/__init__.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/Actions/__init__.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/Actions/__init__.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1 +1 @@
-#import TraverseTo, RedirectTo
+#

Modified: zope-cmfformcontroller/branches/upstream/current/BaseControllerPageTemplate.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/BaseControllerPageTemplate.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/BaseControllerPageTemplate.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,20 +1,9 @@
-# ###########################################################################
-
 import Globals
 from AccessControl import ClassSecurityInfo
-from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from Products.CMFCore.permissions import ManagePortal, View
+from Products.CMFCore.permissions import View
 from Products.CMFCore.utils import getToolByName
 from ControllerBase import ControllerBase
-from ControllerState import ControllerState
-from FormValidator import FormValidatorKey, FormValidator
-from FormAction import FormActionKey, FormAction
-from globalVars import ANY_CONTEXT, ANY_BUTTON
 
-import sys
-from urllib import quote
-
-
 class BaseControllerPageTemplate(ControllerBase):
 
     security = ClassSecurityInfo()

Modified: zope-cmfformcontroller/branches/upstream/current/ControllerBase.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/ControllerBase.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/ControllerBase.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,16 +1,3 @@
-##############################################################################
-#
-# Copyright (c) 2001 Zope Corporation and Contributors. 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
-#
-##########################################################################
-
 import os
 from Acquisition import aq_base
 from Globals import InitializeClass
@@ -19,7 +6,7 @@
 from Products.CMFCore.permissions import View, ManagePortal
 from Products.CMFCore.utils import getToolByName, expandpath
 from Products.CMFCore.FSMetadata import FSMetadata, CMFConfigParser
-from FormAction import FormActionType, FormAction, FormActionContainer
+from FormAction import FormAction, FormActionContainer
 from FormValidator import FormValidator, FormValidatorContainer
 from globalVars import ANY_CONTEXT, ANY_BUTTON
 from utils import log

Modified: zope-cmfformcontroller/branches/upstream/current/ControllerPageTemplate.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/ControllerPageTemplate.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/ControllerPageTemplate.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,19 +1,13 @@
-from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate as BaseClass
-
 import os
 import Globals
 from AccessControl import ClassSecurityInfo
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from Products.CMFCore.permissions import ManagePortal, View
-from Products.CMFCore.utils import getToolByName
-from ControllerBase import ControllerBase
-from ControllerState import ControllerState
-from ValidationError import ValidationError
+from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate as BaseClass
+from Products.CMFCore.permissions import View
 from BaseControllerPageTemplate import BaseControllerPageTemplate
 from FormAction import FormActionContainer
 from FormValidator import FormValidatorContainer
 
-import sys
 from urllib import quote
 
 # ###########################################################################

Modified: zope-cmfformcontroller/branches/upstream/current/ControllerPageTemplateFile.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/ControllerPageTemplateFile.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/ControllerPageTemplateFile.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -11,18 +11,18 @@
 #
 # THIS FILE CONTAINS MODIFIED CODE FROM ZOPE 2.6.2
 ##########################################################################
-""" Zope object encapsulating a controlled page templates that comes from the filesystem.
+"""Zope object encapsulating a controlled page templates that comes from the
+   filesystem.
 """
 
 import os
-import Globals, Acquisition
 from AccessControl import ClassSecurityInfo
 from Products.CMFCore.permissions import View
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile as BaseClass
 from Products.PageTemplates.TALES import CompilerError
 from BaseControllerPageTemplate import BaseControllerPageTemplate
 from FSControllerBase import FSControllerBase
-from utils import logException
+from utils import log, logException
 
 
 class ControllerPageTemplateFile(BaseClass, BaseControllerPageTemplate, FSControllerBase):

Modified: zope-cmfformcontroller/branches/upstream/current/ControllerPythonScript.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/ControllerPythonScript.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/ControllerPythonScript.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -18,18 +18,14 @@
 Python code.
 """
 
-__version__='$Revision: 1.10 $'[11:-2]
-
-import sys, os, re
+import os, re
 from Globals import package_home
-import AccessControl, OFS
+import AccessControl
 from OFS.SimpleItem import SimpleItem
 from urllib import quote
 from Shared.DC.Scripts.Script import BindingsUI
-from AccessControl import getSecurityManager
 from OFS.History import Historical
 from OFS.Cache import Cacheable
-from zLOG import LOG, ERROR, INFO, PROBLEM
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.CMFCore.utils import getToolByName
 from Script import PythonScript as BaseClass

Modified: zope-cmfformcontroller/branches/upstream/current/ControllerState.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/ControllerState.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/ControllerState.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,7 +1,6 @@
 import Globals
 import AccessControl
 from AccessControl import ClassSecurityInfo
-from Acquisition import aq_inner, aq_parent, aq_chain, aq_self, Implicit
 from Products.CMFCore.utils import getToolByName
 from FormAction import FormAction
 from globalVars import ANY_CONTEXT, ANY_BUTTON

Modified: zope-cmfformcontroller/branches/upstream/current/ControllerValidator.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/ControllerValidator.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/ControllerValidator.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -18,23 +18,18 @@
 Python code.
 """
 
-__version__='$Revision: 1.8 $'[11:-2]
-
-import sys, os, re
+import os
 from Globals import package_home
-import AccessControl, OFS
+import AccessControl
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from OFS.SimpleItem import SimpleItem
 from urllib import quote
 from Shared.DC.Scripts.Script import BindingsUI
-from AccessControl import getSecurityManager
 from OFS.History import Historical
 from OFS.Cache import Cacheable
-from zLOG import LOG, ERROR, INFO, PROBLEM
 from Products.CMFCore.utils import getToolByName
 from Script import PythonScript as BaseClass
 from ControllerBase import ControllerBase
-from FormAction import FormActionContainer
 from interfaces import IControllerValidator
 
 from zope.interface import implements

Modified: zope-cmfformcontroller/branches/upstream/current/Extensions/Install.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/Extensions/Install.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/Extensions/Install.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,10 +1,5 @@
-from cStringIO import StringIO
-from Products.CMFCore.DirectoryView import addDirectoryViews
-from Products.CMFCore.utils import getToolByName
-from Products.CMFFormController import GLOBALS
-import string
+from StringIO import StringIO
 
-
 def install(self):
     out = StringIO()
 

Modified: zope-cmfformcontroller/branches/upstream/current/FSControllerPageTemplate.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/FSControllerPageTemplate.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/FSControllerPageTemplate.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -21,18 +21,12 @@
 from AccessControl import ClassSecurityInfo
 from OFS.Cache import Cacheable
 from Products.PageTemplates.ZopePageTemplate import Src
-from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.CMFCore.DirectoryView import registerFileExtension, registerMetaType
-from Products.CMFCore.permissions import View, ManagePortal
-from Products.CMFCore.utils import expandpath
-from Products.CMFCore.FSPageTemplate import FSPageTemplate
+from Products.CMFCore.permissions import View
 from Products.CMFCore.FSPageTemplate import FSPageTemplate as BaseClass
 from BaseControllerPageTemplate import BaseControllerPageTemplate
 from ControllerPageTemplate import ControllerPageTemplate
-from ControllerBase import ControllerBase
 from FSControllerBase import FSControllerBase
-from FormAction import FormActionContainer
-from FormValidator import FormValidatorContainer
 from utils import log, logException
 
 class FSControllerPageTemplate(FSControllerBase, BaseClass, BaseControllerPageTemplate):

Modified: zope-cmfformcontroller/branches/upstream/current/FSControllerPythonScript.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/FSControllerPythonScript.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/FSControllerPythonScript.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -14,21 +14,17 @@
 """ Customizable controlled python scripts that come from the filesystem.
 """
 
-import re
 import copy
 from zope.tales.tales import CompilerError
 
 import Globals, Acquisition
 from AccessControl import ClassSecurityInfo
 from OFS.Cache import Cacheable
-from Products.PageTemplates.ZopePageTemplate import Src
-from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.CMFCore.DirectoryView import registerFileExtension, registerMetaType
-from Products.CMFCore.permissions import View, ManagePortal
+from Products.CMFCore.permissions import View
 from Products.CMFCore.utils import getToolByName, expandpath
 from Script import FSPythonScript as BaseClass
 from ControllerPythonScript import ControllerPythonScript
-from ControllerBase import ControllerBase
 from ControllerState import ControllerState
 from FSControllerBase import FSControllerBase
 from utils import log, logException

Modified: zope-cmfformcontroller/branches/upstream/current/FSControllerValidator.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/FSControllerValidator.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/FSControllerValidator.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -14,18 +14,14 @@
 """ Customizable controlled python scripts that come from the filesystem.
 """
 
-import copy
-import Globals, Acquisition
+import Globals
 from AccessControl import ClassSecurityInfo
 from OFS.Cache import Cacheable
-from Products.PageTemplates.ZopePageTemplate import Src
-from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.CMFCore.DirectoryView import registerFileExtension, registerMetaType
-from Products.CMFCore.permissions import View, ManagePortal
+from Products.CMFCore.permissions import View
 from Products.CMFCore.utils import getToolByName
 from Script import FSPythonScript as BaseClass
 from ControllerValidator import ControllerValidator
-from ControllerState import ControllerState
 from ControllerBase import ControllerBase
 from utils import logException
 from interfaces import IControllerValidator

Modified: zope-cmfformcontroller/branches/upstream/current/FormAction.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/FormAction.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/FormAction.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,17 +1,13 @@
-# ##############################################################################
-import copy
 from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass
 from OFS.SimpleItem import SimpleItem
 from Products.CMFCore.utils import getToolByName
 from Key import Key
 from globalVars import ANY_CONTEXT, ANY_BUTTON
-from utils import log
 from Acquisition import aq_base
 
 _marker = []
 
-# ##############################################################################
 class FormActionType(SimpleItem):
 
     security = ClassSecurityInfo()
@@ -33,7 +29,7 @@
 
 InitializeClass(FormActionType)
 
-# ##############################################################################
+
 class FormActionKey(Key):
 
     security = ClassSecurityInfo()
@@ -50,16 +46,6 @@
         if not status:
             raise ValueError, 'Illegal status %s' % (status)
 
-#        if context_type:
-#            if controller:
-#                if not context_type in controller.listContextTypes():
-#                    log('Unknown context type %s for template %s' % (str(context_type), str(object_id)))
-#                    # Don't raise an exception because sometimes full list of
-#                    # types may be unavailable (e.g. when moving a site)
-#                    # raise ValueError, 'Illegal context type %s' % context_type
-#        else:
-#            context_type = ANY_CONTEXT
-
         if not context_type:
             context_type = ANY_CONTEXT
 
@@ -85,7 +71,6 @@
 InitializeClass(FormActionKey)
 
 
-# ##############################################################################
 class FormAction(SimpleItem):
 
     security = ClassSecurityInfo()
@@ -141,7 +126,7 @@
 
 InitializeClass(FormAction)
 
-# ##############################################################################
+
 class FormActionContainer(SimpleItem):
 
     security = ClassSecurityInfo()

Modified: zope-cmfformcontroller/branches/upstream/current/FormController.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/FormController.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/FormController.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,7 +1,5 @@
-form_action_types = {}
-
 from __future__ import nested_scopes
-import os, string
+import os
 from AccessControl import ClassSecurityInfo
 import Globals
 from OFS.ObjectManager import bad_id
@@ -16,9 +14,9 @@
 from FormAction import FormActionType, FormActionKey, FormAction, FormActionContainer
 from FormValidator import FormValidatorKey, FormValidator, FormValidatorContainer
 from ValidationError import ValidationError
-from globalVars import ANY_CONTEXT, ANY_BUTTON
 
 _marker = []
+form_action_types = {}
 
 def registerFormAction(id, factory, description=''):
     form_action_types[id] = FormActionType(id, factory, description)

Modified: zope-cmfformcontroller/branches/upstream/current/FormValidator.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/FormValidator.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/FormValidator.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,16 +1,13 @@
-# ##############################################################################
 from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass
 from OFS.SimpleItem import SimpleItem
 from Products.CMFCore.utils import getToolByName
 from Key import Key
 from globalVars import ANY_CONTEXT, ANY_BUTTON
-from utils import log
 from Acquisition import aq_base
 
 _marker = []
 
-# ##############################################################################
 class FormValidatorKey(Key):
 
     security = ClassSecurityInfo()
@@ -25,17 +22,6 @@
                 if s:
                     raise ValueError, 'Illegal template id: %s' % s
 
-#        if context_type:
-#            if controller:
-#                if not context_type in controller.listContextTypes():
-#                    log('Unknown context type %s for template %s' % (str(context_type), str(object_id)))
-#                    # Don't raise an exception because sometimes full list of
-#                    # types may be unavailable (e.g. when moving a site)
-#                    # raise ValueError, 'Illegal context type %s' % context_type
-#                    raise ValueError, 'Illegal context type %s' % context_type
-#        else:
-#            context_type = ANY_CONTEXT
-
         if not context_type:
             context_type = ANY_CONTEXT
 
@@ -58,7 +44,6 @@
 InitializeClass(FormValidatorKey)
 
 
-# ##############################################################################
 class FormValidator(SimpleItem):
 
     security = ClassSecurityInfo()
@@ -99,7 +84,7 @@
 
 InitializeClass(FormValidator)
 
-# ##############################################################################
+
 class FormValidatorContainer(SimpleItem):
 
     security = ClassSecurityInfo()

Modified: zope-cmfformcontroller/branches/upstream/current/HISTORY.txt
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/HISTORY.txt	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/HISTORY.txt	2007-02-09 13:49:09 UTC (rev 622)
@@ -2,6 +2,14 @@
 
     (name of developer listed in brackets)
 
+CMFFormController 2.0.6 - Released November 4, 2006
+
+    - General code cleaned, removed unused imports.
+      [hannosch]
+
+    - Converted log functions to use the logging package instead of zLOG.
+      [hannosch]
+
 CMFFormController 2.0.5 - Released September 8, 2006
 
     - Modernized type checking to use isinstance() instead of type() as the

Modified: zope-cmfformcontroller/branches/upstream/current/Script.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/Script.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/Script.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -12,15 +12,17 @@
 # THIS FILE CONTAINS MODIFIED CODE FROM ZOPE 2.6.2
 ##############################################################################
 
+import logging
+import re
+
 import Globals
-from Shared.DC.Scripts.Script import Script
 from Shared.DC.Scripts.Bindings import NameAssignments as BaseNameAssignments
 from Products.PythonScripts.PythonScript import PythonScript as BasePythonScript
 from Products.CMFCore.FSPythonScript import FSPythonScript as BaseFSPythonScript, bad_func_code
-import sys
-import re
-from zLOG import LOG, ERROR, INFO, PROBLEM
+from ZODB.POSException import ConflictError
 
+logger = logging.getLogger('CMFFormController')
+
 defaultBindings = {'name_context': 'context',
                    'name_container': 'container',
                    'name_m_self': 'script',
@@ -121,8 +123,10 @@
                 self.ZBindings_edit(bindmap)
             else:
                 self._makeFunction()
+        except (ConflictError, KeyboardInterrupt):
+            raise
         except:
-            LOG(self.meta_type, ERROR, 'write failed', error=sys.exc_info())
+            logger.exception('%s write failed' % self.meta_type)
             raise
 
 Globals.InitializeClass(PythonScript)

Modified: zope-cmfformcontroller/branches/upstream/current/__init__.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/__init__.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/__init__.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,7 +1,5 @@
 """Initialize CMFFormController"""
 
-import sys
-from Products.CMFCore.DirectoryView import registerDirectory
 from Products.CMFCore.utils import registerIcon, ToolInit
 
 from config import *
@@ -13,9 +11,6 @@
 
 GLOBALS = globals()
 
-# Make the skins available as DirectoryViews
-# registerDirectory('skins', globals())
-
 def initialize(context):
     tools = (FormController.FormController,)
     ToolInit('Form Controller Tool',

Modified: zope-cmfformcontroller/branches/upstream/current/exportimport/formcontroller.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/exportimport/formcontroller.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/exportimport/formcontroller.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -12,12 +12,11 @@
 ##############################################################################
 """CMFFormController setup handlers.
 
-$Id: formcontroller.py 22942 2006-05-01 21:46:48Z hannosch $
+$Id: formcontroller.py 31740 2006-10-13 12:31:41Z hannosch $
 """
 
 import os
 from AccessControl import ClassSecurityInfo
-from AccessControl.Permission import Permission
 from Globals import InitializeClass
 from Globals import package_home
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
@@ -25,7 +24,7 @@
 from Products.CMFCore.utils import getToolByName
 from Products.CMFCore.permissions import ManagePortal
 
-from Products.GenericSetup.utils import CONVERTER, DEFAULT, KEY
+from Products.GenericSetup.utils import DEFAULT, KEY
 from Products.GenericSetup.utils import ImportConfiguratorBase, ExportConfiguratorBase
 
 _pkgdir = package_home( globals() )
@@ -61,7 +60,7 @@
     for validator in fc_info['validators']:
         fc.validators.set(FormValidator(validator['object_id'], validator['context_type'], validator['button'], str(validator['validators']).split(',')))
     for action in fc_info['actions']:
-        fc.actions.set(FormAction(action['object_id'], action['status'], action['context_type'], action['button'], action['action_type'], action['action_arg']))
+        fc.actions.set(FormAction(action['object_id'], action['status'], action['context_type'], action['button'], action['action_type'], str(action['action_arg'])))
 
     return 'CMFFormController settings imported.'
 

Modified: zope-cmfformcontroller/branches/upstream/current/tests/testCopyRename.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/tests/testCopyRename.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/tests/testCopyRename.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -4,7 +4,6 @@
 
 import unittest
 
-from Testing import ZopeTestCase
 from Products.PloneTestCase import PloneTestCase
 PloneTestCase.setupPloneSite()
 

Modified: zope-cmfformcontroller/branches/upstream/current/tests/test_exportimport.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/tests/test_exportimport.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/tests/test_exportimport.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -211,7 +211,25 @@
         self.assertEqual(validator.getButton(), self.V_BUTTON)
         self.assertEqual(validator.getValidators(), self.V_VALIDATORS)
 
+    def test_action_not_unicode(self):
+        """
+        the action arg cannot be unicode for unrestrictedTraverse calls to
+        work properly
+        """
 
+        from Products.CMFFormController.exportimport \
+             import importCMFFormController
+
+        site = self._initSite(with_info=False)
+        fc = site.portal_form_controller
+
+        context = DummyImportContext(site)
+        context._files['cmfformcontroller.xml'] = self._WITH_INFO_EXPORT
+        importCMFFormController(context)
+
+        action = fc.listFormActions()[0]
+        self.failUnless(isinstance(action.getActionArg(), str))
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(CMFFormControllerExportConfiguratorTests),

Modified: zope-cmfformcontroller/branches/upstream/current/utils.py
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/utils.py	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/utils.py	2007-02-09 13:49:09 UTC (rev 622)
@@ -1,10 +1,11 @@
+import logging
 import sys
 import traceback
-from zLOG import LOG, INFO, WARNING
 
+logger = logging.getLogger('CMFFormController')
 
-def log(summary='', text='', log_level=INFO):
-    LOG('Plone Debug', log_level, summary, text)
+def log(summary='', text='', log_level=logging.INFO):
+    logger.log(log_level, '%s \n%s' % (summary, text))
 
 # Enable scripts to get the string value of an exception
 # even if the thrown exception is a string and not a
@@ -24,4 +25,4 @@
     """Dump an exception to the log"""
     log(summary=str(exceptionString()),
         text='\n'.join(traceback.format_exception(*sys.exc_info())),
-        log_level=WARNING)
+        log_level=logging.WARNING)

Modified: zope-cmfformcontroller/branches/upstream/current/version.txt
===================================================================
--- zope-cmfformcontroller/branches/upstream/current/version.txt	2007-02-09 13:48:43 UTC (rev 621)
+++ zope-cmfformcontroller/branches/upstream/current/version.txt	2007-02-09 13:49:09 UTC (rev 622)
@@ -1 +1 @@
-2.0.5
+2.0.6




More information about the pkg-zope-commits mailing list