[Checkins] SVN: Products.ZCatalog/trunk/ Remove docstrings from various methods, as they shouldn't be web-publishable. This incorporates patches from PloneHotfix20110720

Hanno Schlichting hannosch at hannosch.eu
Thu Feb 10 15:10:20 EST 2011


Log message for revision 120259:
  Remove docstrings from various methods, as they shouldn't be web-publishable. This incorporates patches from PloneHotfix20110720
  

Changed:
  U   Products.ZCatalog/trunk/CHANGES.txt
  U   Products.ZCatalog/trunk/src/Products/ZCatalog/ZCatalog.py

-=-
Modified: Products.ZCatalog/trunk/CHANGES.txt
===================================================================
--- Products.ZCatalog/trunk/CHANGES.txt	2011-02-10 16:14:32 UTC (rev 120258)
+++ Products.ZCatalog/trunk/CHANGES.txt	2011-02-10 20:10:19 UTC (rev 120259)
@@ -4,6 +4,7 @@
 2.13.6 (unreleased)
 -------------------
 
+- Remove docstrings from various methods, as they shouldn't be web-publishable.
 
 2.13.5 (2011-02-05)
 -------------------

Modified: Products.ZCatalog/trunk/src/Products/ZCatalog/ZCatalog.py
===================================================================
--- Products.ZCatalog/trunk/src/Products/ZCatalog/ZCatalog.py	2011-02-10 16:14:32 UTC (rev 120258)
+++ Products.ZCatalog/trunk/src/Products/ZCatalog/ZCatalog.py	2011-02-10 20:10:19 UTC (rev 120259)
@@ -169,6 +169,7 @@
     def __len__(self):
         return len(self._catalog)
 
+    security.declareProtected(manage_zcatalog_entries, 'manage_edit')
     def manage_edit(self, RESPONSE, URL1, threshold=1000, REQUEST=None):
         """ edit the catalog """
         if not isinstance(threshold, int):
@@ -178,6 +179,7 @@
         RESPONSE.redirect(
             URL1 + '/manage_main?manage_tabs_message=Catalog%20Changed')
 
+    security.declareProtected(manage_zcatalog_entries, 'manage_subbingToggle')
     def manage_subbingToggle(self, REQUEST, RESPONSE, URL1):
         """ toggle subtransactions """
         if self.threshold:
@@ -405,6 +407,7 @@
                 URL1 +
                 '/manage_catalogIndexes?manage_tabs_message=Index%20Cleared')
 
+    security.declareProtected(manage_zcatalog_entries, 'reindexIndex')
     def reindexIndex(self, name, REQUEST, pghandler=None):
         if isinstance(name, str):
             name = (name, )
@@ -457,8 +460,6 @@
     security.declareProtected(manage_zcatalog_entries, 'catalog_object')
     def catalog_object(self, obj, uid=None, idxs=None, update_metadata=1,
                        pghandler=None):
-        """ wrapper around catalog """
-
         if uid is None:
             try:
                 uid = obj.getPhysicalPath
@@ -504,47 +505,48 @@
 
     security.declareProtected(manage_zcatalog_entries, 'uncatalog_object')
     def uncatalog_object(self, uid):
-        """Wrapper around catalog """
         self._catalog.uncatalogObject(uid)
 
     security.declareProtected(search_zcatalog, 'uniqueValuesFor')
     def uniqueValuesFor(self, name):
-        """Return the unique values for a given FieldIndex """
+        # Return the unique values for a given FieldIndex
         return self._catalog.uniqueValuesFor(name)
 
     security.declareProtected(search_zcatalog, 'getpath')
     def getpath(self, rid):
-        """Return the path to a cataloged object given a 'data_record_id_'
-        """
+        # Return the path to a cataloged object given a 'data_record_id_'
         return self._catalog.paths[rid]
 
+    security.declareProtected(search_zcatalog, 'getrid')
     def getrid(self, path, default=None):
-        """Return 'data_record_id_' the to a cataloged object given a 'path'
-        """
+        # Return 'data_record_id_' the to a cataloged object given a 'path'
         return self._catalog.uids.get(path, default)
 
     security.declareProtected(search_zcatalog, 'getobject')
     def getobject(self, rid, REQUEST=None):
-        """Return a cataloged object given a 'data_record_id_'
-        """
+        # Return a cataloged object given a 'data_record_id_'
         return aq_parent(self).unrestrictedTraverse(self.getpath(rid))
 
+    security.declareProtected(search_zcatalog, 'getMetadataForUID')
     def getMetadataForUID(self, uid):
-        """return the correct metadata given the uid, usually the path"""
+        # return the correct metadata given the uid, usually the path
         rid = self._catalog.uids[uid]
         return self._catalog.getMetadataForRID(rid)
 
+    security.declareProtected(search_zcatalog, 'getIndexDataForUID')
     def getIndexDataForUID(self, uid):
-        """return the current index contents given the uid, usually the path"""
+        # return the current index contents given the uid, usually the path
         rid = self._catalog.uids[uid]
         return self._catalog.getIndexDataForRID(rid)
 
+    security.declareProtected(search_zcatalog, 'getMetadataForRID')
     def getMetadataForRID(self, rid):
-        """return the correct metadata for the cataloged record id"""
+        # return the correct metadata for the cataloged record id
         return self._catalog.getMetadataForRID(int(rid))
 
+    security.declareProtected(search_zcatalog, 'getIndexDataForRID')
     def getIndexDataForRID(self, rid):
-        """return the current index contents for the specific rid"""
+        # return the current index contents for the specific rid
         return self._catalog.getIndexDataForRID(rid)
 
     security.declareProtected(search_zcatalog, 'schema')
@@ -628,7 +630,7 @@
 
     security.declareProtected(search_zcatalog, 'valid_roles')
     def valid_roles(self):
-        "Return list of valid roles"
+        # Return list of valid roles
         obj=self
         dict={}
         dup =dict.has_key
@@ -647,6 +649,7 @@
         roles.sort()
         return roles
 
+    security.declareProtected(manage_zcatalog_entries, 'ZopeFindAndApply')
     def ZopeFindAndApply(self, obj, obj_ids=None, obj_metatypes=None,
                          obj_searchterm=None, obj_expr=None,
                          obj_mtime=None, obj_mspec=None,
@@ -746,12 +749,10 @@
 
     security.declareProtected(search_zcatalog, 'resolve_url')
     def resolve_url(self, path, REQUEST):
-        """
-        Attempt to resolve a url into an object in the Zope
-        namespace. The url may be absolute or a catalog path
-        style url. If no object is found, None is returned.
-        No exceptions are raised.
-        """
+        # Attempt to resolve a url into an object in the Zope
+        # namespace. The url may be absolute or a catalog path
+        # style url. If no object is found, None is returned.
+        # No exceptions are raised.
         if REQUEST:
             script=REQUEST.script
             if path.find(script) != 0:
@@ -761,18 +762,18 @@
             except Exception:
                 pass
 
+    security.declareProtected(search_zcatalog, 'resolve_path')
     def resolve_path(self, path):
-        """
-        Attempt to resolve a url into an object in the Zope
-        namespace. The url may be absolute or a catalog path
-        style url. If no object is found, None is returned.
-        No exceptions are raised.
-        """
+        # Attempt to resolve a url into an object in the Zope
+        # namespace. The url may be absolute or a catalog path
+        # style url. If no object is found, None is returned.
+        # No exceptions are raised.
         try:
             return self.unrestrictedTraverse(path)
         except Exception:
             pass
 
+    security.declareProtected(manage_zcatalog_entries, 'manage_normalize_paths')
     def manage_normalize_paths(self, REQUEST):
         """Ensure that all catalog paths are full physical paths
 
@@ -830,6 +831,7 @@
 
     # Indexing methods
 
+    security.declareProtected(manage_zcatalog_indexes, 'addIndex')
     def addIndex(self, name, type, extra=None):
         if IPluggableIndex.providedBy(type):
             self._catalog.addIndex(name, type)
@@ -869,15 +871,19 @@
 
         self._catalog.addIndex(name, index)
 
+    security.declareProtected(manage_zcatalog_indexes, 'delIndex')
     def delIndex(self, name):
         self._catalog.delIndex(name)
 
+    security.declareProtected(manage_zcatalog_indexes, 'clearIndex')
     def clearIndex(self, name):
         self._catalog.getIndex(name).clear()
 
+    security.declareProtected(manage_zcatalog_indexes, 'addColumn')
     def addColumn(self, name, default_value=None):
         return self._catalog.addColumn(name, default_value)
 
+    security.declareProtected(manage_zcatalog_indexes, 'delColumn')
     def delColumn(self, name):
         return self._catalog.delColumn(name)
 



More information about the checkins mailing list