[CMF-checkins] CVS: Products/CMFCore - CatalogTool.py:1.42.2.6 FSDTMLMethod.py:1.16.4.4 FSImage.py:1.14.18.5 FSPythonScript.py:1.21.4.4 FSSTXMethod.py:1.8.12.3 PortalContent.py:1.42.10.2 PortalFolder.py:1.45.4.10 TypesTool.py:1.53.2.6 WorkflowCore.py:1.12.28.3 WorkflowTool.py:1.38.4.3 utils.py:1.39.2.7

Sidnei da Silva sidnei at awkly.org
Wed Mar 16 12:58:24 EST 2005


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv4965/CMFCore

Modified Files:
      Tag: CMF-1_4-branch
	CatalogTool.py FSDTMLMethod.py FSImage.py FSPythonScript.py 
	FSSTXMethod.py PortalContent.py PortalFolder.py TypesTool.py 
	WorkflowCore.py WorkflowTool.py utils.py 
Log Message:

- Get rid of apply
- Behave accordingly with Zope 2.8


=== Products/CMFCore/CatalogTool.py 1.42.2.5 => 1.42.2.6 ===
--- Products/CMFCore/CatalogTool.py:1.42.2.5	Thu Nov 18 10:55:32 2004
+++ Products/CMFCore/CatalogTool.py	Wed Mar 16 12:57:53 2005
@@ -263,7 +263,7 @@
                     range = 'min:max'
                 kw[k] = {'query': query, 'range': range}
 
-        return apply(ZCatalog.searchResults, (self, REQUEST), kw)
+        return ZCatalog.searchResults(self, REQUEST, **kw)
 
     __call__ = searchResults
 


=== Products/CMFCore/FSDTMLMethod.py 1.16.4.3 => 1.16.4.4 ===
--- Products/CMFCore/FSDTMLMethod.py:1.16.4.3	Fri Apr 23 17:11:33 2004
+++ Products/CMFCore/FSDTMLMethod.py	Wed Mar 16 12:57:53 2005
@@ -131,14 +131,14 @@
         
             if client is None:
                 # Called as subtemplate, so don't need error propagation!
-                r=apply(Globals.HTML.__call__, (self, client, REQUEST), kw)
+                r=Globals.HTML.__call__(self, client, REQUEST, **kw)
                 if RESPONSE is None: result = r
                 else: result = decapitate(r, RESPONSE)
                 if not self._cache_namespace_keys:
                     self.ZCacheable_set(result)
                 return result
 
-            r=apply(Globals.HTML.__call__, (self, client, REQUEST), kw)
+            r=Globals.HTML.__call__(self, client, REQUEST, **kw)
             if type(r) is not type('') or RESPONSE is None:
                 if not self._cache_namespace_keys:
                     self.ZCacheable_set(r)
@@ -183,16 +183,16 @@
         return getSecurityManager().validate(inst, parent, name, value)
 
     security.declareProtected(FTPAccess, 'manage_FTPget')
-    manage_FTPget = DTMLMethod.manage_FTPget
+    manage_FTPget = DTMLMethod.manage_FTPget.im_func
 
     security.declareProtected(ViewManagementScreens, 'PrincipiaSearchSource')
-    PrincipiaSearchSource = DTMLMethod.PrincipiaSearchSource
+    PrincipiaSearchSource = DTMLMethod.PrincipiaSearchSource.im_func
 
     security.declareProtected(ViewManagementScreens, 'document_src')
-    document_src = DTMLMethod.document_src
+    document_src = DTMLMethod.document_src.im_func
 
     security.declareProtected(ViewManagementScreens, 'manage_haveProxy')
-    manage_haveProxy = DTMLMethod.manage_haveProxy
+    manage_haveProxy = DTMLMethod.manage_haveProxy.im_func
 
 Globals.InitializeClass(FSDTMLMethod)
 


=== Products/CMFCore/FSImage.py 1.14.18.4 => 1.14.18.5 ===
--- Products/CMFCore/FSImage.py:1.14.18.4	Sun Nov 14 18:15:06 2004
+++ Products/CMFCore/FSImage.py	Wed Mar 16 12:57:53 2005
@@ -74,14 +74,14 @@
 
     #### The following is mainly taken from OFS/Image.py ###
         
-    __str__ = Image.__str__
+    __str__ = Image.__str__.im_func
 
     _image_tag = Image.tag
     security.declareProtected(View, 'tag')
     def tag(self, *args, **kw):
         # Hook into an opportunity to reload metadata.
         self._updateFromFS()
-        return apply(self._image_tag, args, kw)
+        return self._image_tag(*args, **kw)
 
     security.declareProtected(View, 'index_html')
     def index_html(self, REQUEST, RESPONSE):


=== Products/CMFCore/FSPythonScript.py 1.21.4.3 => 1.21.4.4 ===
--- Products/CMFCore/FSPythonScript.py:1.21.4.3	Fri Apr 23 17:11:33 2004
+++ Products/CMFCore/FSPythonScript.py	Wed Mar 16 12:57:53 2005
@@ -157,7 +157,7 @@
         security=getSecurityManager()
         security.addContext(self)
         try:
-            result = apply(f, args, kw)
+            result = f(*args, **kw)
             if keyset is not None:
                 # Store the result in the cache.
                 self.ZCacheable_set(result, keywords=keyset)           
@@ -202,7 +202,7 @@
     def params(self): return self._params
 
     security.declareProtected(ViewManagementScreens, 'manage_haveProxy')
-    manage_haveProxy = PythonScript.manage_haveProxy
+    manage_haveProxy = PythonScript.manage_haveProxy.im_func
 
     security.declareProtected(ViewManagementScreens, 'body')
     def body(self): return self._body


=== Products/CMFCore/FSSTXMethod.py 1.8.12.2 => 1.8.12.3 ===
--- Products/CMFCore/FSSTXMethod.py:1.8.12.2	Fri Apr 23 17:11:33 2004
+++ Products/CMFCore/FSSTXMethod.py	Wed Mar 16 12:57:53 2005
@@ -119,7 +119,7 @@
 
         if RESPONSE is not None:
             RESPONSE.setHeader( 'Content-Type', 'text/html' )
-        return apply( self._render, ( REQUEST, RESPONSE ), kw )
+        return self._render(REQUEST, RESPONSE, **kw)
 
     security.declarePrivate( '_render' )
     def _render( self, REQUEST={}, RESPONSE=None, **kw ):
@@ -134,7 +134,7 @@
         else:
             posargs = ()
         
-        return apply( template, posargs, { 'cooked' : self.cook() } )
+        return template(*posargs, **{'cooked': self.cook()})
 
     security.declareProtected( FTPAccess, 'manage_FTPget' )
     def manage_FTPget( self ):


=== Products/CMFCore/PortalContent.py 1.42.10.1 => 1.42.10.2 ===
--- Products/CMFCore/PortalContent.py:1.42.10.1	Sat May 24 10:40:31 2003
+++ Products/CMFCore/PortalContent.py	Wed Mar 16 12:57:53 2005
@@ -111,7 +111,7 @@
         '''
         view = _getViewFor(self)
         if getattr(aq_base(view), 'isDocTemp', 0):
-            return apply(view, (self, self.REQUEST))
+            return view(self, self.REQUEST)
         else:
             return view()
 


=== Products/CMFCore/PortalFolder.py 1.45.4.9 => 1.45.4.10 ===
--- Products/CMFCore/PortalFolder.py:1.45.4.9	Mon Aug  9 12:33:14 2004
+++ Products/CMFCore/PortalFolder.py	Wed Mar 16 12:57:53 2005
@@ -192,7 +192,7 @@
             return []
         filt['portal_type'] = pt
 
-        query = apply( ContentFilter, (), filt )
+        query = ContentFilter(**filt)
         result = []
         append = result.append
         get = self._getOb
@@ -364,10 +364,7 @@
             if not myType.allowType( type_name ):
                 raise ValueError, 'Disallowed subobject type: %s' % type_name
 
-        apply( pt.constructContent
-             , (type_name, self, id, RESPONSE) + args
-             , kw
-             )
+        pt.constructContent(type_name, self, id, RESPONSE, *args, **kw)
 
     security.declareProtected(AddPortalContent, 'checkIdAvailable')
     def checkIdAvailable(self, id):
@@ -649,5 +646,5 @@
         """
         return string.join( self.description, '; ' )
 
-manage_addPortalFolder = PortalFolder.manage_addPortalFolder
+manage_addPortalFolder = PortalFolder.manage_addPortalFolder.im_func
 manage_addPortalFolderForm = DTMLFile( 'folderAdd', globals() )


=== Products/CMFCore/TypesTool.py 1.53.2.5 => 1.53.2.6 ===
--- Products/CMFCore/TypesTool.py:1.53.2.5	Fri Apr 23 17:11:33 2004
+++ Products/CMFCore/TypesTool.py	Wed Mar 16 12:57:53 2005
@@ -119,7 +119,7 @@
                 and kw.has_key('icon')):
                 kw['content_icon'] = kw['icon']
 
-            apply(self.manage_changeProperties, (), kw)
+            self.manage_changeProperties(**kw)
 
         actions = kw.get( 'actions', () )
         # make sure we have a copy
@@ -395,7 +395,7 @@
         else:
             args = ( id, ) + args
 
-        id = apply( m, args, kw ) or id  # allow factory to munge ID
+        id = m(*args, **kw) or id  # allow factory to munge ID
         ob = container._getOb( id )
 
         return self._finishConstruction(ob)
@@ -455,7 +455,7 @@
         constructor = aq_base(constructor).__of__( container )
 
         id = str(id)
-        ob = apply(constructor, (container, id) + args, kw)
+        ob = constructor(container, id, *args, **kw)
 
         return self._finishConstruction(ob)
 
@@ -602,9 +602,9 @@
             fti = fti.copy()
             if fti.has_key('id'):
                 del fti['id']
-            ob = apply(klass, (id,), fti)
+            ob = klass(id, **fti)
         else:
-            ob = apply(klass, (id,))
+            ob = klass(id)
         self._setObject(id, ob)
         if RESPONSE is not None:
             RESPONSE.redirect('%s/manage_main' % self.absolute_url())
@@ -706,7 +706,7 @@
         if not self._checkViewType(info):
             raise Unauthorized,info
 
-        ob = apply(info.constructInstance, (container, id) + args, kw)
+        ob = info.constructInstance(container, id, *args, **kw)
 
         if RESPONSE is not None:
             immediate_url = '%s/%s' % ( ob.absolute_url()


=== Products/CMFCore/WorkflowCore.py 1.12.28.2 => 1.12.28.3 ===
--- Products/CMFCore/WorkflowCore.py:1.12.28.2	Fri Apr 23 17:11:33 2004
+++ Products/CMFCore/WorkflowCore.py	Wed Mar 16 12:57:53 2005
@@ -80,7 +80,7 @@
         if wf is None or not hasattr(wf, 'wrapWorkflowMethod'):
             # No workflow tool found.
             try:
-                res = apply(self._m, (instance,) + args, kw)
+                res = self._m(instance, *args, **kw)
             except ObjectDeleted, ex:
                 res = ex.getResult()
             else:


=== Products/CMFCore/WorkflowTool.py 1.38.4.2 => 1.38.4.3 ===
--- Products/CMFCore/WorkflowTool.py:1.38.4.2	Fri Apr 23 17:11:33 2004
+++ Products/CMFCore/WorkflowTool.py	Wed Mar 16 12:57:53 2005
@@ -343,7 +343,7 @@
                         'Requested workflow definition not found.')
                 else:
                     return default
-        res = apply(wf.getInfoFor, (ob, name, default) + args, kw)
+        res = wf.getInfoFor(ob, name, default, *args, **kw)
         if res is _marker:
             raise WorkflowException('Could not get info: %s' % name)
         return res
@@ -589,7 +589,7 @@
             wfs = ()
         if wf is None:
             # No workflow wraps this method.
-            return apply(func, args, kw)
+            return func(*args, **kw)
         return self._invokeWithNotification(
             wfs, ob, method_id, wf.wrapWorkflowMethod,
             (ob, method_id, func, args, kw), {})
@@ -618,7 +618,7 @@
         for w in wfs:
             w.notifyBefore(ob, action)
         try:
-            res = apply(func, args, kw)
+            res = func(*args, **kw)
         except ObjectDeleted, ex:
             res = ex.getResult()
             reindex = 0


=== Products/CMFCore/utils.py 1.39.2.6 => 1.39.2.7 ===
--- Products/CMFCore/utils.py:1.39.2.6	Sun Nov 14 18:15:06 2004
+++ Products/CMFCore/utils.py	Wed Mar 16 12:57:53 2005
@@ -356,8 +356,8 @@
         'An override that makes the schema fixed.'
         my_kw = kw.copy()
         my_kw['property_extensible_schema__'] = 0
-        return apply(PropertyManager.manage_propertiesForm,
-                     (self, self, REQUEST,) + args, my_kw)
+        form = PropertyManager.manage_propertiesForm.__of__(self)
+        return form(self, self, REQUEST, *args, **my_kw)
 
     security.declarePublic('propertyLabel')
     def propertyLabel(self, id):



More information about the CMF-checkins mailing list