1.1 --- a/EventAggregatorSupport/Resources.py Sat Jan 25 23:40:30 2014 +0100
1.2 +++ b/EventAggregatorSupport/Resources.py Tue Jan 28 01:44:23 2014 +0100
1.3 @@ -2,7 +2,7 @@
1.4 """
1.5 MoinMoin - EventAggregator resource acquisition and access
1.6
1.7 - @copyright: 2008, 2009, 2010, 2011, 2012, 2013 by Paul Boddie <paul@boddie.org.uk>
1.8 + @copyright: 2008, 2009, 2010, 2011, 2012, 2013, 2014 by Paul Boddie <paul@boddie.org.uk>
1.9 @license: GNU GPL (v2 or later), see COPYING.txt for details.
1.10 """
1.11
1.12 @@ -13,7 +13,6 @@
1.13 from MoinSupport import *
1.14 from MoinRemoteSupport import getCachedResource, getCachedResourceMetadata
1.15
1.16 -import codecs
1.17 import urllib
1.18
1.19 try:
1.20 @@ -114,8 +113,7 @@
1.21 # NOTE: the content type provided by the URL.
1.22
1.23 if format == "ical" and vCalendar is not None:
1.24 - parser = vCalendar.parse
1.25 - resource_cls = EventCalendar
1.26 + parser = parseEventsInCalendarFromResource
1.27 required_content_type = expected_content_type or "text/calendar"
1.28 else:
1.29 return None
1.30 @@ -141,11 +139,8 @@
1.31
1.32 # Send the data to the parser.
1.33
1.34 - uf = codecs.getreader(encoding or "utf-8")(f)
1.35 - try:
1.36 - return resource_cls(url, parser(uf), metadata)
1.37 - finally:
1.38 - uf.close()
1.39 + return parser(f, encoding, url, metadata)
1.40 +
1.41 finally:
1.42 f.close()
1.43