[Checkins] SVN: Products.CMFActionIcons/branches/2.1/ - backported all trunk changes as of November 2009 to the 2.1 branch,

Jens Vagelpohl jens at dataflake.org
Tue Nov 17 17:15:46 EST 2009


Log message for revision 105776:
  - backported all trunk changes as of November 2009 to the 2.1 branch, 
    except for the (unnecessary) Zope 2.12 requirement. The 2.1 branch
    will be the "final" release branch for CMFActionIcons.
  

Changed:
  U   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/ActionIconsTool.py
  U   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/CHANGES.txt
  A   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/COPYRIGHT.txt
  A   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/LICENSE.txt
  U   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/README.txt
  U   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/__init__.py
  U   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/configure.zcml
  U   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/exportimport.py
  U   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/export_steps.xml
  U   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/import_steps.xml
  U   Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/metadata.xml
  U   Products.CMFActionIcons/branches/2.1/setup.py

-=-
Modified: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/ActionIconsTool.py
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/ActionIconsTool.py	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/ActionIconsTool.py	2009-11-17 22:15:45 UTC (rev 105776)
@@ -17,21 +17,20 @@
 
 import os
 
-from AccessControl import ClassSecurityInfo
-from Globals import InitializeClass
-from Globals import package_home
+from AccessControl.SecurityInfo import ClassSecurityInfo
+from App.class_init import InitializeClass
+from App.Common import package_home
 from OFS.SimpleItem import SimpleItem
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from zope.interface import implements
 
+from Products.CMFActionIcons.interfaces import IActionIconsTool
+from Products.CMFActionIcons.permissions import ManagePortal
+from Products.CMFActionIcons.permissions import View
 from Products.CMFCore.Expression import Expression
 from Products.CMFCore.utils import registerToolInterface
 from Products.CMFCore.utils import UniqueObject
 
-from interfaces import IActionIconsTool
-from permissions import ManagePortal
-from permissions import View
-
 _wwwdir = os.path.join( package_home( globals() ), 'www' )
 
 

Modified: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/CHANGES.txt
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/CHANGES.txt	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/CHANGES.txt	2009-11-17 22:15:45 UTC (rev 105776)
@@ -4,7 +4,25 @@
 2.1.3-beta (unreleased)
 -----------------------
 
+- backported all trunk changes as of November 2009 to the 2.1 branch, 
+  except for the (unnecessary) Zope 2.12 requirement. The 2.1 branch 
+  will be the "final" release branch for CMFActionIcons.
 
+- Cleaned up / normalized imports:
+
+  o Don't import from Globals;  instead, use real locations.
+
+  o Make other imports use the actual source module, rather than an
+    intermediate (e.g., prefer importing 'ClassSecurityInfo' from
+    'AccessControl.SecurityInfo' rather than from 'AccessControl').
+
+  o Avoid relative imports, which will break in later versions of Python.
+
+- profiles: Removed obsolete local import and export step registrations.
+
+- setup handler: Registered steps globally.
+
+
 2.1.2 (2008-09-13)
 ------------------
 
@@ -12,7 +30,7 @@
 
 
 2.1.2-beta (2008-08-26)
------------------------
+------------------
 
 - completed devolution from monolithic CMF package into its component
   products that are distributed as eggs from PyPI.

Added: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/COPYRIGHT.txt
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/COPYRIGHT.txt	                        (rev 0)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/COPYRIGHT.txt	2009-11-17 22:15:45 UTC (rev 105776)
@@ -0,0 +1,9 @@
+Copyright (c) 2008 Zope Corporation (TM) and Contributors.
+All Rights Reserved.
+
+This software is subject to the provisions of the Zope Public License,
+Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+FOR A PARTICULAR PURPOSE.


Property changes on: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/COPYRIGHT.txt
___________________________________________________________________
Added: svn:eol-style
   + native

Added: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/LICENSE.txt
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/LICENSE.txt	                        (rev 0)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/LICENSE.txt	2009-11-17 22:15:45 UTC (rev 105776)
@@ -0,0 +1,53 @@
+Zope Public License (ZPL) Version 2.1
+
+A copyright notice accompanies this license document that
+identifies the copyright holders.
+
+This license has been certified as open source. It has also
+been designated as GPL compatible by the Free Software
+Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the
+following conditions are met:
+
+1. Redistributions in source code must retain the
+   accompanying copyright notice, this list of conditions,
+   and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the accompanying
+   copyright notice, this list of conditions, and the
+   following disclaimer in the documentation and/or other
+   materials provided with the distribution.
+
+3. Names of the copyright holders must not be used to
+   endorse or promote products derived from this software
+   without prior written permission from the copyright
+   holders.
+
+4. The right to distribute this software or to use it for
+   any purpose does not give you the right to use
+   Servicemarks (sm) or Trademarks (tm) of the copyright
+   holders. Use of them is covered by separate agreement
+   with the copyright holders.
+
+5. If any files are modified, you must cause the modified
+   files to carry prominent notices stating that you changed
+   the files and the date of any change.
+
+Disclaimer
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
+  AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+  NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+  NO EVENT SHALL THE COPYRIGHT HOLDERS BE
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.


Property changes on: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/LICENSE.txt
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/README.txt
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/README.txt	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/README.txt	2009-11-17 22:15:45 UTC (rev 105776)
@@ -4,6 +4,14 @@
 
 .. contents::
 
+NOTE
+====
+
+Starting with CMFCore and CMFDefault versions 2.2.0 the CMFActionIcons
+product is obsolete. Its functionality has been folded into the
+core CMF packages.
+
+
 Overview
 ========
 

Modified: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/__init__.py
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/__init__.py	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/__init__.py	2009-11-17 22:15:45 UTC (rev 105776)
@@ -17,11 +17,11 @@
 $Id$
 """
 
-from Products.CMFCore.utils import ToolInit
+def initialize(context):
 
-import ActionIconsTool
+    from Products.CMFCore.utils import ToolInit
 
-def initialize(context):
+    import ActionIconsTool
 
     ToolInit( meta_type='CMF Action Icons Tool'
             , tools=( ActionIconsTool.ActionIconsTool, )

Modified: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/configure.zcml
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/configure.zcml	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/configure.zcml	2009-11-17 22:15:45 UTC (rev 105776)
@@ -8,11 +8,28 @@
 
   <cmf:registerDirectory name="actionicons"/>
 
+  <!-- exportimport -->
+
+  <genericsetup:importStep
+      name="action-icons"
+      title="Action Icons (deprecated)"
+      description="Import action icon definitions (folded into CMFDefault >= 2.2.0)"
+      handler="Products.CMFActionIcons.exportimport.importActionIconsTool">
+    <depends name="componentregistry"/>
+  </genericsetup:importStep>
+
+  <genericsetup:exportStep
+      name="action-icons"
+      title="Action Icons (deprecated)"
+      description="Export action icon definitions (folded into CMFDefault >= 2.2.0)"
+      handler="Products.CMFActionIcons.exportimport.exportActionIconsTool"
+      />
+
   <!-- profiles -->
 
   <genericsetup:registerProfile
       name="actionicons"
-      title="CMFActionIcons"
+      title="CMFActionIcons (deprecated/folded into CMFDefault >= 2.2.0)"
       description="Adds action icon tool / settings."
       provides="Products.GenericSetup.interfaces.EXTENSION"
       for="Products.CMFCore.interfaces.ISiteRoot"

Modified: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/exportimport.py
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/exportimport.py	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/exportimport.py	2009-11-17 22:15:45 UTC (rev 105776)
@@ -17,22 +17,20 @@
 
 import os
 
-from AccessControl import ClassSecurityInfo
-from Globals import InitializeClass
-from Globals import package_home
+from AccessControl.SecurityInfo import ClassSecurityInfo
+from App.class_init import InitializeClass
+from App.Common import package_home
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-
 from zope.component import getSiteManager
 
+from Products.CMFActionIcons.interfaces import IActionIconsTool
+from Products.CMFActionIcons.permissions import ManagePortal
 from Products.GenericSetup.utils import CONVERTER
 from Products.GenericSetup.utils import DEFAULT
 from Products.GenericSetup.utils import ExportConfiguratorBase
 from Products.GenericSetup.utils import ImportConfiguratorBase
 from Products.GenericSetup.utils import KEY
 
-from interfaces import IActionIconsTool
-from permissions import ManagePortal
-
 _pkgdir = package_home( globals() )
 _xmldir = os.path.join( _pkgdir, 'xml' )
 
@@ -45,15 +43,19 @@
     """ Import action icons tool settings from an XML file.
     """
     site = context.getSite()
+    logger = context.getLogger('action-icons')
+
+    body = context.readDataFile(_FILENAME)
+    if body is None:
+        logger.debug('Nothing to import.')
+        return
+
     sm = getSiteManager(site)
     ait = sm.queryUtility(IActionIconsTool)
     if ait is None:
-        return 'Action icons: No tool!'
+        logger.warning('No tool!')
+        return
 
-    body = context.readDataFile(_FILENAME)
-    if body is None:
-        return 'Action icons: Nothing to import.'
-
     if context.shouldPurge():
         ait.clearActionIcons()
 
@@ -71,21 +73,26 @@
             ait.updateActionIcon(**action_icon)
         else:
             ait.addActionIcon(**action_icon)
+    logger.info('Action icons tool settings imported.')
 
-    return 'Action icons settings imported.'
-
 def exportActionIconsTool(context):
     """ Export caching policy manager settings as an XML file.
     """
     site = context.getSite()
+    logger = context.getLogger('action-icons')
+
+    tool = getSiteManager(site).queryUtility(IActionIconsTool)
+    if tool is None:
+        logger.debug('Nothing to export.')
+        return
+
     mhc = ActionIconsToolExportConfigurator( site ).__of__( site )
     text = mhc.generateXML()
 
     context.writeDataFile( _FILENAME, text, 'text/xml' )
+    logger.info('Action icons tool settings exported.')
 
-    return 'Action icons tool settings exported.'
 
-
 class ActionIconsToolExportConfigurator(ExportConfiguratorBase):
     """ Synthesize XML description of cc properties.
     """

Modified: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/export_steps.xml
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/export_steps.xml	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/export_steps.xml	2009-11-17 22:15:45 UTC (rev 105776)
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-<export-steps>
- <export-step id="action-icons"
-              handler="Products.CMFActionIcons.exportimport.exportActionIconsTool"
-              title="Action Icons">
-  Export action icon definitions
- </export-step>
-</export-steps>

Modified: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/import_steps.xml
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/import_steps.xml	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/import_steps.xml	2009-11-17 22:15:45 UTC (rev 105776)
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<import-steps>
- <import-step id="action-icons" version="20051015-01"
-              handler="Products.CMFActionIcons.exportimport.importActionIconsTool"
-              title="Action Icons">
-  <dependency step="componentregistry"/>
-  Import action icon definitions
- </import-step>
-</import-steps>

Modified: Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/metadata.xml
===================================================================
--- Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/metadata.xml	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/Products/CMFActionIcons/profiles/actionicons/metadata.xml	2009-11-17 22:15:45 UTC (rev 105776)
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<metadata>
-  <version>2.1.1</version>
-</metadata>

Modified: Products.CMFActionIcons/branches/2.1/setup.py
===================================================================
--- Products.CMFActionIcons/branches/2.1/setup.py	2009-11-17 21:55:52 UTC (rev 105775)
+++ Products.CMFActionIcons/branches/2.1/setup.py	2009-11-17 22:15:45 UTC (rev 105776)
@@ -42,14 +42,23 @@
       include_package_data=True,
       namespace_packages=['Products'],
       zip_safe=False,
+      setup_requires=['eggtestinfo',
+                     ],
       install_requires=[
           #'Zope >= 2.10.4',
           'setuptools',
           'Products.CMFCore',
-          'Products.GenericSetup >= 1.3.3',
+          'Products.GenericSetup',
           ],
+      tests_require=[
+          'zope.testing >= 3.7.0',
+          ],
+      test_loader='zope.testing.testrunner.eggsupport:SkipLayers',
+      test_suite='Products.%s.tests' % NAME,
       entry_points="""
       [zope2.initialize]
       Products.%s = Products.%s:initialize
+      [distutils.commands]
+      ftest = zope.testing.testrunner.eggsupport:ftest
       """ % (NAME, NAME),
       )



More information about the checkins mailing list