[tryton-debian-vcs] tryton-modules-calendar-scheduling branch upstream-2.8 updated. upstream/2.8.3-1-g42737f1
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Mon Sep 21 12:28:18 UTC 2015
The following commit has been merged in the upstream-2.8 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-calendar-scheduling.git;a=commitdiff;h=upstream/2.8.3-1-g42737f1
commit 42737f12902d4fb6d0fef429dc7e8dcfe6c67404
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sun Sep 20 19:41:35 2015 +0200
Adding upstream version 2.8.4.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index 0bc052c..7189ddf 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.8.4 - 2015-09-19
+* Bug fixes (see mercurial logs for details)
+
Version 2.8.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 0a6b926..73be854 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: trytond_calendar_scheduling
-Version: 2.8.3
+Version: 2.8.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 b717f57..494afc7 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 7807ce3..0ac115a 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=2.8.3
+version=2.8.4
depends:
calendar
ir
diff --git a/trytond_calendar_scheduling.egg-info/PKG-INFO b/trytond_calendar_scheduling.egg-info/PKG-INFO
index 368bf0d..2ee11d0 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: 2.8.3
+Version: 2.8.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 376dd29..6260a88 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 >= 2.8, < 2.9
trytond >= 2.8, < 2.9
--
tryton-modules-calendar-scheduling
More information about the tryton-debian-vcs
mailing list