[CMF-checkins] CVS: Products/CMFCalendar - CalendarTool.py:1.8.10.4 Event.py:1.13.4.3

Stefan H. Holek stefan at epy.co.at
Thu Jul 29 14:29:50 EDT 2004


Update of /cvs-repository/Products/CMFCalendar
In directory cvs.zope.org:/tmp/cvs-serv21625/CMFCalendar

Modified Files:
      Tag: CMF-1_4-branch
	CalendarTool.py Event.py 
Log Message:
Woops! Check in last batch of fixes from the Plone collector.


=== Products/CMFCalendar/CalendarTool.py 1.8.10.3 => 1.8.10.4 ===
--- Products/CMFCalendar/CalendarTool.py:1.8.10.3	Thu Apr 22 13:47:42 2004
+++ Products/CMFCalendar/CalendarTool.py	Thu Jul 29 14:29:20 2004
@@ -82,6 +82,8 @@
         """Creates a series of weeks, each of which contains an integer day number.
            A day number of 0 means that day is in the previous or next month.
         """
+        year=int(year)
+        month=int(month)
         # daysByWeek is a list of days inside a list of weeks, like so:
         # [[0, 1, 2, 3, 4, 5, 6],
         #  [7, 8, 9, 10, 11, 12, 13],
@@ -125,11 +127,13 @@
     security.declarePublic('catalog_getevents')
     def catalog_getevents(self, year, month):
         """ given a year and month return a list of days that have events """
-        first_date=DateTime(str(month)+'/1/'+str(year))
+        year=int(year)
+        month=int(month)
+        first_date=DateTime(year, month, 1)
         last_day=calendar.monthrange(year, month)[1]
         ## This line was cropping the last day of the month out of the
         ## calendar when doing the query
-        ## last_date=DateTime(str(month)+'/'+str(last_day)+'/'+str(year))
+        ## last_date=DateTime(year, month, last_day)
         last_date=first_date + last_day
 
         query=self.portal_catalog(portal_type=self.calendar_types,
@@ -255,7 +259,7 @@
         else:
             month-=1
 
-        return DateTime(str(month) + '/1/' + str(year))
+        return DateTime(year, month, 1)
 
     security.declarePublic('getNextMonth')
     def getNextMonth(self, month, year):
@@ -272,19 +276,19 @@
         else:
             month+=1
 
-        return DateTime(str(month) + '/1/' + str(year))
+        return DateTime(year, month, 1)
 
     security.declarePublic('getBeginAndEndTimes')
     def getBeginAndEndTimes(self, day, month, year):
         # Given any day, month and year this method returns 2 DateTime objects
         # That represent the exact start and the exact end of that particular day.
 
-        day=str(day)
-        month=str(month)
-        year=str(year)
+        day=int(day)
+        month=int(month)
+        year=int(year)
 
-        begin=DateTime(month+'/'+day+'/'+year+' 12:00:00AM')
-        end=DateTime(month+'/'+day+'/'+year+' 11:59:59PM')
+        begin=DateTime('%d-%02d-%02d 00:00:00' % (year, month, day))
+        end=DateTime('%d-%02d-%02d 23:59:59' % (year, month, day))
 
         return (begin, end)
 


=== Products/CMFCalendar/Event.py 1.13.4.2 => 1.13.4.3 ===
--- Products/CMFCalendar/Event.py:1.13.4.2	Thu Apr 22 13:47:42 2004
+++ Products/CMFCalendar/Event.py	Thu Jul 29 14:29:20 2004
@@ -27,6 +27,7 @@
 from Products.CMFDefault.utils import formatRFC822Headers, html_headcheck
 from Products.CMFDefault.utils import SimpleHTMLParser, bodyfinder, parseHeadersBody
 from Products.CMFCore.utils import keywordsplitter
+from Products.CMFCore.utils import contributorsplitter
 
 import EventPermissions
 
@@ -206,9 +207,9 @@
         start_date = end_date = None
 
         if effectiveDay and effectiveMo and effectiveYear and start_time:
-            efdate = '%s/%s/%s %s %s' % (effectiveDay
+            efdate = '%s/%s/%s %s %s' % (effectiveYear
                                          , effectiveMo
-                                         , effectiveYear
+                                         , effectiveDay
                                          , start_time
                                          , startAMPM
                                          )
@@ -216,9 +217,9 @@
 
         if expirationDay and expirationMo and expirationYear and stop_time:
 
-            exdate = '%s/%s/%s %s %s' % (expirationDay
+            exdate = '%s/%s/%s %s %s' % (expirationYear
                                          , expirationMo
-                                         , expirationYear
+                                         , expirationDay
                                          , stop_time
                                          , stopAMPM
                                          )
@@ -343,9 +344,11 @@
         headers['Format'] = self.Format()
         new_subject = keywordsplitter(headers)
         headers['Subject'] = new_subject or self.Subject()
+        new_contrib = contributorsplitter(headers)
+        headers['Contributors'] = new_contrib or self.Contributors()
         haveheader = headers.has_key
         for key, value in self.getMetadataHeaders():
-            if key != 'Format' and not haveheader(key):
+            if not haveheader(key):
                 headers[key] = value
         self._editMetadata(title=headers['Title'],
                           subject=headers['Subject'],



More information about the CMF-checkins mailing list