1.1 --- a/EventAggregatorSupport/Resources.py Wed Jan 29 19:20:21 2014 +0100
1.2 +++ b/EventAggregatorSupport/Resources.py Wed Jan 29 19:21:20 2014 +0100
1.3 @@ -11,7 +11,7 @@
1.4
1.5 from DateSupport import Date, Month
1.6 from MoinSupport import *
1.7 -from MoinRemoteSupport import getCachedResource, getCachedResourceMetadata
1.8 +from MoinRemoteSupport import getCachedResource, getCachedResourceMetadata, imapreader
1.9
1.10 import urllib
1.11
1.12 @@ -96,6 +96,16 @@
1.13 if url.startswith("file:"):
1.14 return None
1.15
1.16 + # Support IMAP access.
1.17 +
1.18 + elif url.startswith("imap"):
1.19 + reader = imapreader
1.20 +
1.21 + # Otherwise, use the default access mechanism.
1.22 +
1.23 + else:
1.24 + reader = None
1.25 +
1.26 # Parameterise the URL.
1.27 # Where other parameters are used, care must be taken to encode them
1.28 # properly.
1.29 @@ -111,15 +121,15 @@
1.30 parser = parseEventsInCalendarFromResource
1.31 required_content_type = expected_content_type or "text/calendar"
1.32 elif format == "xcal":
1.33 - parser = parseEventsInXMLCalendarFromResource
1.34 - required_content_type = expected_content_type or "application/calendar+xml"
1.35 + parser = parseEventsInXMLCalendarsFromResource
1.36 + required_content_type = expected_content_type or "multipart/mixed"
1.37 else:
1.38 return None
1.39
1.40 # Obtain the resource, using a cached version if appropriate.
1.41
1.42 max_cache_age = int(getattr(request.cfg, "event_aggregator_max_cache_age", "300"))
1.43 - data = getCachedResource(request, url, "EventAggregator", "wiki", max_cache_age)
1.44 + data = getCachedResource(request, url, "EventAggregator", "wiki", max_cache_age, reader)
1.45 if not data:
1.46 return None
1.47