[Checkins] SVN: Products.BTreeFolder2/trunk/src/Products/BTreeFolder2/BTreeFolder2.py Whitespace
Hanno Schlichting
hannosch at hannosch.eu
Sun Jul 11 08:18:52 EDT 2010
Log message for revision 114585:
Whitespace
Changed:
U Products.BTreeFolder2/trunk/src/Products/BTreeFolder2/BTreeFolder2.py
-=-
Modified: Products.BTreeFolder2/trunk/src/Products/BTreeFolder2/BTreeFolder2.py
===================================================================
--- Products.BTreeFolder2/trunk/src/Products/BTreeFolder2/BTreeFolder2.py 2010-07-11 12:16:03 UTC (rev 114584)
+++ Products.BTreeFolder2/trunk/src/Products/BTreeFolder2/BTreeFolder2.py 2010-07-11 12:18:52 UTC (rev 114585)
@@ -77,7 +77,7 @@
pass
-class BTreeFolder2Base (Persistent):
+class BTreeFolder2Base(Persistent):
"""Base for BTree-based folders.
"""
@@ -97,7 +97,6 @@
_mt_index = None # OOBTree: { meta_type -> OIBTree: { id -> 1 } }
title = ''
-
def __init__(self, id=None):
if id is not None:
self.id = id
@@ -108,7 +107,6 @@
self._count = Length()
self._mt_index = OOBTree()
-
def _populateFromFolder(self, source):
"""Fill this folder with the contents of another folder.
"""
@@ -117,7 +115,6 @@
if value is not None:
self._setOb(name, aq_base(value))
-
security.declareProtected(view_management_screens, 'manage_fixCount')
def manage_fixCount(self):
"""Calls self._fixCount() and reports the result as text.
@@ -130,7 +127,6 @@
return ("Fixed count mismatch in BTreeFolder2 at %s. "
"Count was %d; corrected to %d" % (path, old, new))
-
def _fixCount(self):
"""Checks if the value of self._count disagrees with
len(self.objectIds()). If so, corrects self._count. Returns the
@@ -143,7 +139,6 @@
self._count.set(new)
return old, new
-
security.declareProtected(view_management_screens, 'manage_cleanup')
def manage_cleanup(self):
"""Calls self._cleanup() and reports the result as text.
@@ -156,7 +151,6 @@
return ("Fixed BTreeFolder2 at %s. "
"See the log for more details." % path)
-
def _cleanup(self):
"""Cleans up errors in the BTrees.
@@ -207,7 +201,6 @@
LOG.info('Fixed %s.' % path)
return 0
-
def _getOb(self, id, default=_marker):
"""Return the named object from the folder.
"""
@@ -222,7 +215,6 @@
else:
return ob.__of__(self)
-
def _setOb(self, id, object):
"""Store the named object in the folder.
"""
@@ -241,7 +233,6 @@
mti[meta_type] = ids
ids[id] = 1
-
def _delOb(self, id):
"""Remove the named object from the folder.
"""
@@ -260,7 +251,6 @@
# Prune the index.
del mti[meta_type]
-
security.declareProtected(view_management_screens, 'getBatchObjectListing')
def getBatchObjectListing(self, REQUEST=None):
"""Return a structure for a page template to show the list of objects.
@@ -297,7 +287,6 @@
'next_batch_url': next_url,
'formatted_list': ''.join(formatted)}
-
security.declareProtected(view_management_screens,
'manage_object_workspace')
def manage_object_workspace(self, ids=(), REQUEST=None):
@@ -310,7 +299,6 @@
else:
return self.manage_main(self, REQUEST)
-
security.declareProtected(access_contents_information,
'tpValues')
def tpValues(self):
@@ -318,23 +306,18 @@
"""
return ()
-
- security.declareProtected(access_contents_information,
- 'objectCount')
+ security.declareProtected(access_contents_information, 'objectCount')
def objectCount(self):
"""Returns the number of items in the folder."""
return self._count()
-
security.declareProtected(access_contents_information, 'has_key')
def has_key(self, id):
"""Indicates whether the folder has an item by ID.
"""
return self._tree.has_key(id)
-
- security.declareProtected(access_contents_information,
- 'objectIds')
+ security.declareProtected(access_contents_information, 'objectIds')
def objectIds(self, spec=None):
# Returns a list of subobject ids of the current object.
# If 'spec' is specified, returns objects whose meta_type
@@ -356,18 +339,14 @@
else:
return set.keys()
-
- security.declareProtected(access_contents_information,
- 'objectValues')
+ security.declareProtected(access_contents_information, 'objectValues')
def objectValues(self, spec=None):
# Returns a list of actual subobjects of the current object.
# If 'spec' is specified, returns only objects whose meta_type
# match 'spec'.
return LazyMap(self._getOb, self.objectIds(spec))
-
- security.declareProtected(access_contents_information,
- 'objectItems')
+ security.declareProtected(access_contents_information, 'objectItems')
def objectItems(self, spec=None):
# Returns a list of (id, subobject) tuples of the current object.
# If 'spec' is specified, returns only objects whose meta_type match
@@ -375,9 +354,7 @@
return LazyMap(lambda id, _getOb=self._getOb: (id, _getOb(id)),
self.objectIds(spec))
-
- security.declareProtected(access_contents_information,
- 'objectMap')
+ security.declareProtected(access_contents_information, 'objectMap')
def objectMap(self):
# Returns a tuple of mappings containing subobject meta-data.
return LazyMap(lambda (k, v):
@@ -388,9 +365,7 @@
# would be inefficient, so superValues() support is disabled.
_objects = ()
-
- security.declareProtected(access_contents_information,
- 'objectIds_d')
+ security.declareProtected(access_contents_information, 'objectIds_d')
def objectIds_d(self, t=None):
ids = self.objectIds(t)
res = {}
@@ -398,19 +373,15 @@
res[id] = 1
return res
-
- security.declareProtected(access_contents_information,
- 'objectMap_d')
+ security.declareProtected(access_contents_information, 'objectMap_d')
def objectMap_d(self, t=None):
return self.objectMap()
-
def _checkId(self, id, allow_dup=0):
if not allow_dup and self.has_key(id):
raise BadRequestException('The id "%s" is invalid--'
'it is already in use.' % id)
-
def _setObject(self, id, object, roles=None, user=None, set_owner=1,
suppress_events=False):
ob = object # better name, keep original function signature
@@ -450,7 +421,6 @@
return id
-
def _delObject(self, id, dp=1, suppress_events=False):
ob = self._getOb(id)
@@ -465,7 +435,6 @@
notify(ObjectRemovedEvent(ob, self, id))
notifyContainerModified(self)
-
# Aliases for mapping-like access.
__len__ = objectCount
keys = objectIds
@@ -479,7 +448,6 @@
def get(self, name, default=None):
return self._getOb(name, default)
-
# Utility for generating unique IDs.
security.declareProtected(access_contents_information, 'generateId')
More information about the checkins
mailing list