[CMF-checkins] SVN: CMF/trunk/CMFCore/ - CMFCore/FSPropertiesObject and CMFCore/FSMetadata: Removed a wrongly

Jens Vagelpohl jens at dataflake.org
Wed Jul 20 20:00:52 EDT 2005


Log message for revision 37355:
  - CMFCore/FSPropertiesObject and CMFCore/FSMetadata: Removed a wrongly 
    inserted DeprecationWarning in the FSPropertiesObject class and
    put it into the FSMetadata class. We are not deprecating ".props"
    files, but ".properties" and ".security".
  is line, and those below, will be ignored--
  
  M    CMFCore/tests/test_DirectoryView.py
  M    CMFCore/tests/base/testcase.py
  M    CMFCore/FSMetadata.py
  M    CMFCore/FSPropertiesObject.py
  

Changed:
  U   CMF/trunk/CMFCore/FSMetadata.py
  U   CMF/trunk/CMFCore/FSPropertiesObject.py
  U   CMF/trunk/CMFCore/tests/base/testcase.py
  U   CMF/trunk/CMFCore/tests/test_DirectoryView.py

-=-
Modified: CMF/trunk/CMFCore/FSMetadata.py
===================================================================
--- CMF/trunk/CMFCore/FSMetadata.py	2005-07-20 21:26:20 UTC (rev 37354)
+++ CMF/trunk/CMFCore/FSMetadata.py	2005-07-21 00:00:52 UTC (rev 37355)
@@ -19,6 +19,7 @@
 from sys import exc_info
 from os.path import exists
 from ConfigParser import ConfigParser
+from warnings import warn
 
 import re
 
@@ -158,6 +159,8 @@
         except IOError:
             return None
         else:
+            warn('.properties objects will disappear in CMF 1.7 - Use '
+                 '.metadata objects instead.', DeprecationWarning)
             lines = f.readlines()
             f.close()
             props = {}
@@ -186,6 +189,8 @@
         except IOError:
             return None
         else:
+            warn('.security objects will disappear in CMF 1.7 - Use '
+                 '.metadata objects instead.', DeprecationWarning)
             lines = f.readlines()
             f.close()
             prm = {}

Modified: CMF/trunk/CMFCore/FSPropertiesObject.py
===================================================================
--- CMF/trunk/CMFCore/FSPropertiesObject.py	2005-07-20 21:26:20 UTC (rev 37354)
+++ CMF/trunk/CMFCore/FSPropertiesObject.py	2005-07-21 00:00:52 UTC (rev 37355)
@@ -14,8 +14,6 @@
 
 $Id$
 """
-from warnings import warn
-
 import Globals
 from AccessControl import ClassSecurityInfo
 from Acquisition import ImplicitAcquisitionWrapper
@@ -91,9 +89,6 @@
         Read the file (indicated by exandpath(self._filepath), and parse the
         data if necessary.
         """
-        warn('FSProperties objects will disappear in CMF 1.7 - Use '
-             'FSMetadata objects instead.', DeprecationWarning)
-
         fp = expandpath(self._filepath)
 
         file = open(fp, 'r')    # not 'rb', as this is a text file!

Modified: CMF/trunk/CMFCore/tests/base/testcase.py
===================================================================
--- CMF/trunk/CMFCore/tests/base/testcase.py	2005-07-20 21:26:20 UTC (rev 37354)
+++ CMF/trunk/CMFCore/tests/base/testcase.py	2005-07-21 00:00:52 UTC (rev 37355)
@@ -130,7 +130,7 @@
 _prefix = abspath(join(_prefix,'..'))
 
 
-class FSDVTest( TestCase ):
+class FSDVTest( TestCase, WarningInterceptor ):
     # Base class for FSDV test, creates a fake skin
     # copy that can be edited.
 
@@ -139,6 +139,7 @@
     _layername = 'fake_skin'
 
     def _registerDirectory(self, object=None, ignore=None):
+        self._trap_warning_output()
         from Products.CMFCore.DirectoryView import registerDirectory
         from Products.CMFCore.DirectoryView import addDirectoryViews
         if ignore is None:
@@ -224,4 +225,5 @@
 
     def tearDown(self):
         # kill the copy
+        self._free_warning_output()
         rmtree(self.tempname)

Modified: CMF/trunk/CMFCore/tests/test_DirectoryView.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_DirectoryView.py	2005-07-20 21:26:20 UTC (rev 37354)
+++ CMF/trunk/CMFCore/tests/test_DirectoryView.py	2005-07-21 00:00:52 UTC (rev 37355)
@@ -34,6 +34,7 @@
     """
 
     def setUp(self):
+        self._trap_warning_output()
         from Products.CMFCore.DirectoryView import registerDirectory
         from Products.CMFCore.DirectoryView import addDirectoryViews
         registerDirectory('fake_skins', _prefix)



More information about the CMF-checkins mailing list