diff --git a/tabellio/icalimport/icalimport.py b/tabellio/icalimport/icalimport.py index 884b9bd..405f27c 100644 --- a/tabellio/icalimport/icalimport.py +++ b/tabellio/icalimport/icalimport.py @@ -1,6 +1,9 @@ +# -*- coding: utf-8 -*- + import datetime import urllib2 import vobject +import rfc822 from zope import component from zope.event import notify @@ -57,6 +60,17 @@ class IcalImport(BrowserView): except: pass + if location and '@' in location: + try: + location, email = rfc822.parseaddr(location) + except: + pass + + if location: + # some special substitutions for PCF common locations + location = location.replace(u'HL ', u'Hôtel de Ligne - ') + location = location.replace(u'HG ', u'Hôtel du Greffe - ') + base_id = '%(year)04d%(month)02d%(day)02d' base_parts = {'year': date_start.year, 'month': date_start.month,