[CMF-checkins] CVS: CMF/CMFDefault - SyndicationTool.py:1.9.2.2

Andrew Sawyers andrew@zope.com
Fri, 18 Jan 2002 11:14:30 -0500


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv20776/CMFDefault

Modified Files:
      Tag: CMF-1_2-branch
	SyndicationTool.py 
Log Message:

*Fixed bugs in SyndicationTool module where methods weren't properly dealing with the case when obj was None.
*Fixed zpt skin to properly select the update frequency.


=== CMF/CMFDefault/SyndicationTool.py 1.9.2.1 => 1.9.2.2 ===
         if not self.isSiteSyndicationAllowed():
             raise 'Syndication is Not Allowed'
+        if obj is None:
+            return self.syUpdatePeriod
         else:
             syInfo = getattr(obj, 'syndication_information',
                              None)
             if syInfo is not None:
                 return syInfo.syUpdatePeriod
             else:
-                #return self.syUpdatePeriod
                 return 'Syndication is Not Allowed'
     
     security.declarePublic('getUpdateFrequency')
@@ -252,6 +253,8 @@
         """
         if not self.isSiteSyndicationAllowed():
             raise 'Syndication is not Allowed'
+        if obj is None:
+            return self.syUpdateFrequency
         else:
             syInfo = getattr(obj, 'syndication_information',
                              None)
@@ -276,6 +279,9 @@
         #import pdb; pdb.set_trace()
         if not self.isSiteSyndicationAllowed():
             raise 'Syndication is not Allowed'
+        if obj is None:
+            when = self.syUpdateBase
+            return when.ISO()
         else:
             syInfo = getattr(obj, 'syndication_information',
                                None)
@@ -292,6 +298,9 @@
         """
         if not self.isSiteSyndicationAllowed():
             raise 'Syndication is not Allowed'
+        if obj is None:
+            when = syUpdateBase
+            return when.HTML4()
         else:
             syInfo = getattr(obj, 'syndication_information',
                                 None)
@@ -307,6 +316,8 @@
         """
         if not self.isSiteSyndicationAllowed():
             raise 'Syndication is not Allowed'
+        if obj is None:
+            return self.max_items
         else:
             syInfo = getattr(obj, 'syndication_information',
                                 None)