[CMF-checkins] CVS: Products/CMFDefault - Portal.py:1.48 __init__.py:1.26

Jens Vagelpohl jens at dataflake.org
Sun Oct 31 11:33:24 EST 2004


Update of /cvs-repository/Products/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv28136/CMFDefault

Modified Files:
	Portal.py __init__.py 
Log Message:
- Cleaning out some super-ancient code for migrating/fixing PTK content


=== Products/CMFDefault/Portal.py 1.47 => 1.48 ===
--- Products/CMFDefault/Portal.py:1.47	Fri Oct 29 13:07:42 2004
+++ Products/CMFDefault/Portal.py	Sun Oct 31 11:33:24 2004
@@ -79,8 +79,7 @@
     title = ''
     description = ''
 
-    __ac_permissions__=( ( ManagePortal, ('manage_migrate_content',) )
-                       , ( AddPortalContent, () )
+    __ac_permissions__=( ( AddPortalContent, () )
                        , ( AddPortalFolders, () )
                        , ( ListPortalMembers, () )
                        , ( ReplyToItem, () )
@@ -103,77 +102,6 @@
             in 'editMetadata').
         """
         pass
-
-    #
-    #   The following two methods allow conversion of portal content from
-    #   PTK version 0.7.1.
-    #   DO NOT REMOVE!!!
-    #
-    if 0:
-        def manage_migrate_content(self, REQUEST):
-            """
-                Converts instances of Products.PTKBase.<content> to
-                instances of Products.PTKDemo.<content>.
-            """
-            import Products.PTKBase.Document
-            import Products.PTKBase.File
-            import Products.PTKBase.Image
-            import Products.PTKBase.Link
-            import Products.PTKBase.NewsItem
-            import NewsItem, Link, Document, File, Image
-
-            migrations = {
-                Products.PTKBase.Document.Document : Document.Document,
-                Products.PTKBase.File.File         : File.File,
-                Products.PTKBase.Image.Image       : Image.Image,
-                Products.PTKBase.Link.Link         : Link.Link,
-                Products.PTKBase.NewsItem.NewsItem : NewsItem.NewsItem,
-                }
-
-            visited = []
-            migrated = []
-            self.__migrate_branches(migrations, self, migrated, visited)
-            return 'Converted:\n%s\n\nDone.' % '\n'.join(migrated)
-
-        def __migrate_branches(self, migrations, branch, migrated, visited):
-            base = getattr(branch, 'aq_base', branch)
-            if base in visited:
-                # Don't visit again!
-                return
-            visited.append(base)
-
-            try: changed = branch._p_changed
-            except: changed = 1
-            for id in branch.objectIds():
-                obj = branch._getOb(id)
-                obase = getattr(obj, 'aq_base', obj)
-                klass = obase.__class__
-                if migrations.has_key(klass):
-                    # Replace this object.
-                    changed = 1
-                    newob = migrations[klass](obase.id)
-                    newob.id = obase.id   # This line activates obase.
-                    newob.__dict__.update(obase.__dict__)
-                    setattr(branch, id, newob)
-                    migrated.append(obj.absolute_url())
-                elif hasattr(obase, 'objectIds'):
-                    # Enter a sub-branch.
-                    self.__migrate_branches(migrations, obj, migrated, visited)
-                else:
-                    # Unload this object if it has not been changed.
-                    try:
-                        if obj._p_changed is None:
-                            obj._p_deactivate()
-                    except: pass
-            if changed is None:
-                # Unload this branch.
-                object._p_deactivate()
-
-        del visited[-1]
-
-    else:   # placeholder
-        def manage_migrate_content( self, REQUEST ):
-            pass
 
 InitializeClass(CMFSite)
 


=== Products/CMFDefault/__init__.py 1.25 => 1.26 ===
--- Products/CMFDefault/__init__.py:1.25	Tue Sep 14 15:02:21 2004
+++ Products/CMFDefault/__init__.py	Sun Oct 31 11:33:24 2004
@@ -44,35 +44,6 @@
 import SyndicationTool
 import DefaultWorkflow
 
-
-#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-#   N.B.:  The following symbol controls whether we "inject" the
-#          content types which formerly lived in CMFCore back into
-#          it.  While it is initially true (to allow existing portal
-#          content to load), in a future release it will be set to
-#          false;  the behavior it governs will eventually be removed
-#          altogether.  YOU HAVE BEEN WARNED!!!
-#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-SUPPLY_DEPRECATED_PTK_BASE_ALIASES = 0
-
-if SUPPLY_DEPRECATED_PTK_BASE_ALIASES:
-
-    #   Get the old module names aliased into sys.modules...
-    __module_aliases__ = ( ( 'Products.PTKBase.Document', Document )
-                         , ( 'Products.PTKBase.File', File )
-                         , ( 'Products.PTKBase.Image', Image )
-                         , ( 'Products.PTKBase.Link', Link )
-                         , ( 'Products.PTKBase.NewsItem', NewsItem )
-                         )
-
-    #   ...and make sure we can find them in PTKBase when we do
-    #   'manage_migrate_content()'.
-    Products.PTKBase.Document = Document
-    Products.PTKBase.File = File
-    Products.PTKBase.Image = Image
-    Products.PTKBase.Link = Link
-    Products.PTKBase.NewsItem = NewsItem
-
 contentClasses = ( Document.Document
                  , File.File
                  , Image.Image



More information about the CMF-checkins mailing list