[CMF-checkins] CVS: CMF/CMFCore - utils.py:1.23.4.1

Tres Seaver tseaver@zope.com
Fri, 19 Jul 2002 16:22:31 -0400


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv12882/CMFCore

Modified Files:
      Tag: CMF-1_3-branch
	utils.py 
Log Message:


  Code hygeine:

  - Normalize imports.

  - Normalize whitespace.

  - Clean up docstrings.

  - Reorder to group related utilities.

  - Remove dead code.

  TODO: Use ModuleSecurityInfo to make explicit which functions
        should be available to TTW code.


=== CMF/CMFCore/utils.py 1.23 => 1.23.4.1 === (477/577 lines abridged)
 # 
 ##############################################################################
 
+import sys
+import os
+from os import path as os_path
+import re
+import operator
 from types import StringType
 
 from ExtensionClass import Base
-from AccessControl import ClassSecurityInfo, getSecurityManager
+from Acquisition import aq_get, aq_inner, aq_parent
+
+from AccessControl import ClassSecurityInfo
+from AccessControl import ModuleSecurityInfo
+from AccessControl import getSecurityManager
 from AccessControl.Permission import Permission
 from AccessControl.PermissionRole import rolesForPermissionOn
 from AccessControl.Role import gather_permissions
-import Globals
-from Acquisition import aq_get, aq_inner, aq_parent
-from string import split
-import os, re
+
 from Globals import package_home
-from string import lower
+from Globals import InitializeClass
+from Globals import HTMLFile
+from Globals import ImageFile
+from Globals import MessageDialog
 
-try: from OFS.ObjectManager import UNIQUE
-except ImportError: UNIQUE = 2
+from OFS.PropertyManager import PropertyManager
+from OFS.SimpleItem import SimpleItem
+from OFS.PropertySheets import PropertySheets
+from OFS.misc_ import misc_ as misc_images
+from OFS.misc_ import Misc_ as MiscImage
+try:
+    from OFS.ObjectManager import UNIQUE
+except ImportError:
+    UNIQUE = 2
 
+import StructuredText
+from StructuredText.HTMLWithImages import HTMLWithImages
 
-_dtmldir = os.path.join( package_home( globals() ), 'dtml' )
+_STXDWI = StructuredText.DocumentWithImages.__class__
 

[-=- -=- -=- 477 lines omitted -=- -=- -=-]

-                    self.notifyModified()
-
-        def __setattr__(self, name, val):
-            self.__dict__[name] = val
-            self._p_changed = 1
-            self.__doNotify()
-
-        def __delattr__(self, name):
-            del self.__dict__[name]
-            self._p_changed = 1
-            self.__doNotify()
-
-        def notifyModified(self):
-            # To be overridden.
-            pass
-
-
-if 0:
-  # Prototype for a "UniqueId" base ZClass.
-  import OFS
-
-  class UniqueSheet(OFS.PropertySheets.PropertySheet,
-                  OFS.PropertySheets.View):
-    'Manage id of unique objects'
-
-    manage = Globals.HTMLFile('uniqueid', globals())
-
-    def getId(self):
-        return self.getClassAttr('id')
-
-    def manage_edit(self, id, REQUEST=None):
-        self.setClassAttr('id', id)
-        if REQUEST is not None:
-            return self.manage(self, REQUEST)
-
-
-  class ZUniqueObjectPropertySheets(OFS.PropertySheets.PropertySheets):
-
-    unique = UniqueSheet('unique')
-
-  class ZUniqueObject:
-    '''Mix-in for unique zclass instances.'''
-
-    _zclass_ = UniqueObject
-
-    propertysheets = ZUniqueObjectPropertySheets()
-
-    manage_options = (
-        {'label': 'Id', 'action':'propertysheets/unique/manage'},
-        )