[Checkins] SVN: Sandbox/shane/republish/zope.app.publisher/ Provided deprecation stubs that are only importable when the

Shane Hathaway shane at hathawaymix.org
Sun Feb 8 00:36:43 EST 2009


Log message for revision 96227:
  Provided deprecation stubs that are only importable when the
  'zope_3_4_compat' extra is enabled.
  
  This avoids a hard dependency on zope.httpformdate, which seems
  appropriate because I could find no code anywhere that actually
  uses the fieldconverters module.
  
  

Changed:
  U   Sandbox/shane/republish/zope.app.publisher/CHANGES.txt
  U   Sandbox/shane/republish/zope.app.publisher/buildout.cfg
  U   Sandbox/shane/republish/zope.app.publisher/setup.py
  A   Sandbox/shane/republish/zope.app.publisher/src/zope/app/publisher/fieldconverters.py

-=-
Modified: Sandbox/shane/republish/zope.app.publisher/CHANGES.txt
===================================================================
--- Sandbox/shane/republish/zope.app.publisher/CHANGES.txt	2009-02-08 04:45:07 UTC (rev 96226)
+++ Sandbox/shane/republish/zope.app.publisher/CHANGES.txt	2009-02-08 05:36:43 UTC (rev 96227)
@@ -5,6 +5,9 @@
 3.6.1 (unreleased)
 ==================
 
+- Moved the zope.app.publisher.fieldconverters module, which contained
+  only the :date converter, to a new package named zope.httpformdate.
+
 - ...
 
 3.6.0 (2009-01-31)

Modified: Sandbox/shane/republish/zope.app.publisher/buildout.cfg
===================================================================
--- Sandbox/shane/republish/zope.app.publisher/buildout.cfg	2009-02-08 04:45:07 UTC (rev 96226)
+++ Sandbox/shane/republish/zope.app.publisher/buildout.cfg	2009-02-08 05:36:43 UTC (rev 96227)
@@ -1,11 +1,16 @@
 [buildout]
 develop = .
-parts = test coverage-test coverage-report
+parts = test coverage-test coverage-report python
 
 [test]
 recipe = zc.recipe.testrunner
 eggs = zope.app.publisher [test]
 
+[python]
+recipe = zc.recipe.egg
+eggs = zope.app.publisher [test, zope_3_4_compat]
+interpreter = python
+
 [coverage-test]
 recipe = zc.recipe.testrunner
 eggs = zope.app.publisher [test]

Modified: Sandbox/shane/republish/zope.app.publisher/setup.py
===================================================================
--- Sandbox/shane/republish/zope.app.publisher/setup.py	2009-02-08 04:45:07 UTC (rev 96226)
+++ Sandbox/shane/republish/zope.app.publisher/setup.py	2009-02-08 05:36:43 UTC (rev 96227)
@@ -68,6 +68,7 @@
                    'zope.app.securitypolicy',
                    'zope.app.zcmlfiles',
                    'zope.site'],
+          'zope_3_4_compat': ['zope.httpformdate'],
           },
 
       zip_safe = False,

Added: Sandbox/shane/republish/zope.app.publisher/src/zope/app/publisher/fieldconverters.py
===================================================================
--- Sandbox/shane/republish/zope.app.publisher/src/zope/app/publisher/fieldconverters.py	                        (rev 0)
+++ Sandbox/shane/republish/zope.app.publisher/src/zope/app/publisher/fieldconverters.py	2009-02-08 05:36:43 UTC (rev 96227)
@@ -0,0 +1,33 @@
+##############################################################################
+#
+# Copyright (c) 2003 Zope Corporation 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.
+#
+##############################################################################
+"""Stub to make old imports work.
+"""
+
+import pkg_resources
+
+_dist_name = "zope.app.publisher"
+_extra = 'zope_3_4_compat'
+if _extra not in pkg_resources.get_distribution(_dist_name).extras:
+    raise ImportError("The module '%s' is not available unless "
+        "the %s egg is installed with the '%s' extra option."
+        % (__name__, _dist_name, _extra))
+
+from zope.deferredimport import deprecated
+
+deprecated("This function has moved to zope.httpformdate.",
+    field2date_via_datetimeutils=
+        "zope.httpformdate:field2date_via_datetimeutils",
+    registerZopeConverters=
+        "zope.httpformdate:register",
+    )



More information about the Checkins mailing list