[tryton-debian-vcs] tryton-modules-calendar-scheduling branch debian-jessie-3.0 updated. debian/3.0.3-1-2-ga0265e1

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Mon Sep 21 12:28:16 UTC 2015


The following commit has been merged in the debian-jessie-3.0 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-calendar-scheduling.git;a=commitdiff;h=debian/3.0.3-1-2-ga0265e1

commit a0265e1b3245481869f0fadc9d3369dde1c3830e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Sep 20 19:42:29 2015 +0200

    Releasing debian version 3.0.4-1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/debian/changelog b/debian/changelog
index 2d31aa1..c7656ad 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-modules-calendar-scheduling (3.0.4-1) unstable; urgency=medium
+
+  * Merging upstream version 3.0.4.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Sun, 20 Sep 2015 19:42:29 +0200
+
 tryton-modules-calendar-scheduling (3.0.3-1) unstable; urgency=medium
 
   * Merging upstream version 3.0.3.
commit 2d9defe4a6fbb50cf2f98e7537bf45fb1e0f35ba
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Sep 20 19:42:29 2015 +0200

    Merging upstream version 3.0.4.

diff --git a/CHANGELOG b/CHANGELOG
index 5b01459..7158072 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.0.4 - 2015-09-19
+* Bug fixes (see mercurial logs for details)
+
 Version 3.0.3 - 2015-05-22
 * Bug fixes (see mercurial logs for details)
 
diff --git a/INSTALL b/INSTALL
index e1bc701..71b3a4d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -8,6 +8,7 @@ Prerequisites
  * trytond (http://www.tryton.org/)
  * trytond_calendar (http://www.tryton.org/)
  * pywebdav 0.9.8 or later (http://sourceforge.net/projects/pywebdav/)
+ * python-dateutil (http://labix.org/python-dateutil)
 
 Installation
 ------------
diff --git a/PKG-INFO b/PKG-INFO
index 7cdf58d..bdecf6b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_calendar_scheduling
-Version: 3.0.3
+Version: 3.0.4
 Summary: Tryton module to add scheduling support on CalDAV
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/calendar_.py b/calendar_.py
index d738d88..682dd73 100644
--- a/calendar_.py
+++ b/calendar_.py
@@ -4,6 +4,8 @@ from email.mime.base import MIMEBase
 from email.mime.multipart import MIMEMultipart
 import logging
 
+import dateutil.tz
+
 from trytond.model import fields
 from trytond.tools import get_smtp_server
 from trytond.transaction import Transaction
@@ -11,6 +13,7 @@ from trytond.pool import Pool, PoolMeta
 
 __all__ = ['Event', 'EventAttendee']
 __metaclass__ = PoolMeta
+tzlocal = dateutil.tz.tzlocal()
 
 
 class Event:
@@ -95,6 +98,9 @@ class Event:
                 (self.organizer_schedule_status,)
 
         if Transaction().context.get('skip_schedule_agent'):
+            if (hasattr(vevent, 'organizer')
+                    and hasattr(vevent.organizer, 'schedule_agent_param')):
+                del vevent.organizer.schedule_agent_param
             return ical
 
         if self.organizer_schedule_agent:
@@ -122,18 +128,28 @@ class Event:
                 summary = self.raise_user_error('no_subject',
                         raise_exception=False)
 
-        date = Lang.strftime(self.dtstart, lang.code, lang.date)
+        if self.timezone:
+            tzevent = dateutil.tz.gettz(self.timezone)
+        else:
+            tzevent = tzlocal
+        dtstart = self.dtstart.replace(tzinfo=tzlocal).astimezone(tzevent)
+        if self.dtend:
+            dtend = self.dtend.replace(tzinfo=tzlocal).astimezone(tzevent)
+        else:
+            dtend = None
+
+        date = Lang.strftime(dtstart, lang.code, lang.date)
         if not self.all_day:
-            date += ' ' + Lang.strftime(self.dtstart, lang.code, '%H:%M')
+            date += ' ' + Lang.strftime(dtstart, lang.code, '%H:%M')
             if self.dtend:
                 date += ' -'
                 if self.dtstart.date() != self.dtend.date():
-                    date += ' ' + Lang.strftime(self.dtend, lang.code,
+                    date += ' ' + Lang.strftime(dtend, lang.code,
                         lang.date)
-                date += ' ' + Lang.strftime(self.dtend, lang.code, '%H:%M')
+                date += ' ' + Lang.strftime(dtend, lang.code, '%H:%M')
         else:
             if self.dtend and self.dtstart.date() != self.dtend.date():
-                date += ' - ' + Lang.strftime(self.dtend, lang.code, lang.date)
+                date += ' - ' + Lang.strftime(dtend, lang.code, lang.date)
         if self.timezone:
             date += ' ' + self.timezone
 
@@ -199,11 +215,9 @@ class Event:
         msg_body.set_payload(body.encode('UTF-8'), 'UTF-8')
         inner.attach(msg_body)
 
-        attachment = MIMEBase('text', 'calendar')
-        attachment.set_payload(ical.serialize())
-        attachment.add_header('Content-Transfer-Encoding', 'quoted-printable',
-                charset='UTF-8',
-                method=ical.method.value.lower())
+        attachment = MIMEBase('text', 'calendar',
+            method=ical.method.value)
+        attachment.set_payload(ical.serialize(), 'UTF-8')
         inner.attach(attachment)
 
         msg.attach(inner)
@@ -495,6 +509,10 @@ class AttendeeMixin:
 
     @classmethod
     def attendee2values(cls, attendee):
+        # Those params don't need to be stored
+        for param in ['received_dtstamp_param', 'received_sequence_param']:
+            if hasattr(attendee, param):
+                delattr(attendee, param)
         values = super(AttendeeMixin, cls).attendee2values(attendee)
         if hasattr(attendee, 'schedule_status'):
             if attendee.schedule_status in dict(
@@ -521,6 +539,8 @@ class AttendeeMixin:
                 del attendee.schedule_status_param
 
         if Transaction().context.get('skip_schedule_agent'):
+            if hasattr(attendee, 'schedule_agent_param'):
+                del attendee.schedule_agent_param
             return attendee
 
         if self.schedule_agent:
@@ -577,18 +597,28 @@ class EventAttendee(AttendeeMixin, object):
                 summary = self.raise_user_error('no_subject',
                         raise_exception=False)
 
-        date = Lang.strftime(event.dtstart, lang.code, lang.date)
+        if event.timezone:
+            tzevent = dateutil.tz.gettz(event.timezone)
+        else:
+            tzevent = tzlocal
+        dtstart = event.dtstart.replace(tzinfo=tzlocal).astimezone(tzevent)
+        if event.dtend:
+            dtend = event.dtend.replace(tzinfo=tzlocal).astimezone(tzevent)
+        else:
+            dtend = None
+
+        date = Lang.strftime(dtstart, lang.code, lang.date)
         if not event.all_day:
-            date += ' ' + Lang.strftime(event.dtstart, lang.code, '%H:%M')
+            date += ' ' + Lang.strftime(dtstart, lang.code, '%H:%M')
             if event.dtend:
                 date += ' -'
                 if event.dtstart.date() != event.dtend.date():
-                    date += ' ' + Lang.strftime(event.dtend, lang.code,
+                    date += ' ' + Lang.strftime(dtend, lang.code,
                         lang.date)
-                date += ' ' + Lang.strftime(event.dtend, lang.code, '%H:%M')
+                date += ' ' + Lang.strftime(dtend, lang.code, '%H:%M')
         else:
             if event.dtend and event.dtstart.date() != event.dtend.date():
-                date += ' - ' + Lang.strftime(event.dtend, lang.code,
+                date += ' - ' + Lang.strftime(dtend, lang.code,
                     lang.date)
         if event.timezone:
             date += ' ' + event.timezone
@@ -670,11 +700,9 @@ class EventAttendee(AttendeeMixin, object):
         msg_body.set_payload(body.encode('UTF-8'), 'UTF-8')
         inner.attach(msg_body)
 
-        attachment = MIMEBase('text', 'calendar')
-        attachment.set_payload(ical.serialize())
-        attachment.add_header('Content-Transfer-Encoding', 'quoted-printable',
-                charset='UTF-8',
-                method=ical.method.value.lower())
+        attachment = MIMEBase('text', 'calendar',
+            method=ical.method.value)
+        attachment.set_payload(ical.serialize(), 'UTF-8')
         inner.attach(attachment)
 
         msg.attach(inner)
@@ -752,6 +780,8 @@ class EventAttendee(AttendeeMixin, object):
 
             with Transaction().set_context(skip_schedule_agent=True):
                 ical = attendee.event.event2ical()
+                # Only the current attendee is needed
+                ical.vevent.attendee_list = [attendee.attendee2attendee()]
             if not hasattr(ical, 'method'):
                 ical.add('method')
             ical.method.value = 'REPLY'
@@ -787,6 +817,8 @@ class EventAttendee(AttendeeMixin, object):
 
             with Transaction().set_context(skip_schedule_agent=True):
                 ical = attendee.event.event2ical()
+                # Only the current attendee is needed
+                ical.vevent.attendee_list = [attendee.attendee2attendee()]
             if not hasattr(ical, 'method'):
                 ical.add('method')
             ical.method.value = 'REPLY'
@@ -826,6 +858,8 @@ class EventAttendee(AttendeeMixin, object):
 
             with Transaction().set_context(skip_schedule_agent=True):
                 ical = attendee.event.event2ical()
+                # Only the current attendee is needed
+                ical.vevent.attendee_list = [attendee.attendee2attendee()]
             if not hasattr(ical, 'method'):
                 ical.add('method')
             ical.method.value = 'REPLY'
diff --git a/setup.py b/setup.py
index d562854..429f671 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
 major_version = int(major_version)
 minor_version = int(minor_version)
 
-requires = ['PyWebDAV >= 0.9.8']
+requires = ['PyWebDAV >= 0.9.8', 'python-dateutil']
 for dep in info.get('depends', []):
     if not re.match(r'(ir|res|webdav)(\W|$)', dep):
         requires.append('trytond_%s >= %s.%s, < %s.%s' %
diff --git a/tryton.cfg b/tryton.cfg
index 2aa5a0a..5ade411 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.0.3
+version=3.0.4
 depends:
     calendar
     ir
diff --git a/trytond_calendar_scheduling.egg-info/PKG-INFO b/trytond_calendar_scheduling.egg-info/PKG-INFO
index d78809b..962f009 100644
--- a/trytond_calendar_scheduling.egg-info/PKG-INFO
+++ b/trytond_calendar_scheduling.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond-calendar-scheduling
-Version: 3.0.3
+Version: 3.0.4
 Summary: Tryton module to add scheduling support on CalDAV
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/trytond_calendar_scheduling.egg-info/requires.txt b/trytond_calendar_scheduling.egg-info/requires.txt
index 410d67c..a687ae1 100644
--- a/trytond_calendar_scheduling.egg-info/requires.txt
+++ b/trytond_calendar_scheduling.egg-info/requires.txt
@@ -1,4 +1,5 @@
 PyWebDAV >= 0.9.8
+python-dateutil
 trytond_calendar >= 3.0, < 3.1
 trytond >= 3.0, < 3.1
 
-- 
tryton-modules-calendar-scheduling



More information about the tryton-debian-vcs mailing list