##// END OF EJS Templates
feedgenerator: fixed missing utc definition.
marcink -
r4274:10b9ffbb default
parent child Browse files
Show More
@@ -34,6 +34,8 b' from __future__ import unicode_literals'
34
34
35 import datetime
35 import datetime
36 from StringIO import StringIO
36 from StringIO import StringIO
37
38 import pytz
37 from six.moves.urllib import parse as urlparse
39 from six.moves.urllib import parse as urlparse
38
40
39 from rhodecode.lib.feedgenerator import datetime_safe
41 from rhodecode.lib.feedgenerator import datetime_safe
@@ -227,13 +229,13 b' class SyndicationFeed(object):'
227 latest_date = item_date
229 latest_date = item_date
228
230
229 # datetime.now(tz=utc) is slower, as documented in django.utils.timezone.now
231 # datetime.now(tz=utc) is slower, as documented in django.utils.timezone.now
230 return latest_date or datetime.datetime.utcnow().replace(tzinfo=utc)
232 return latest_date or datetime.datetime.utcnow().replace(tzinfo=pytz.utc)
231
233
232
234
233 class Enclosure(object):
235 class Enclosure(object):
234 "Represents an RSS enclosure"
236 """Represents an RSS enclosure"""
235 def __init__(self, url, length, mime_type):
237 def __init__(self, url, length, mime_type):
236 "All args are expected to be Python Unicode objects"
238 """All args are expected to be Python Unicode objects"""
237 self.length, self.mime_type = length, mime_type
239 self.length, self.mime_type = length, mime_type
238 self.url = iri_to_uri(url)
240 self.url = iri_to_uri(url)
239
241
General Comments 0
You need to be logged in to leave comments. Login now