1 import time
2
3 import cherrypy
4
5 import turbogears
6 from warnings import warn
7
9 """ Object for generating feeds in multiple formats """
10
12 self.default = default
13 self.formats = ["atom1.0", "atom0.3", "rss2.0"]
14
16 date = date.strftime("%Y-%m-%dT%H:%M:%SZ")
17 return date
18
20 date = date.strftime("%a, %d %b %Y %H:%M:%S GMT")
21 return date
22
23 - def depr_entrys(self, feed):
24 if "entrys" in feed:
25 warn("You should use 'entries' instead of 'entrys'",
26 DeprecationWarning, 3)
27 feed['entries'] = feed['entrys']
28 del feed['entrys']
29
44
47 index = turbogears.expose()(index)
48
55 atom1_0 = turbogears.expose(template="turbogears.feed.atom1_0",
56 format="xml", content_type="application/atom+xml")(atom1_0)
57
64 atom0_3 = turbogears.expose(template="turbogears.feed.atom0_3",
65 format="xml", content_type="application/atom+xml")(atom0_3)
66
72 rss2_0 = turbogears.expose(template="turbogears.feed.rss2_0",
73 format="xml", content_type="application/rss+xml")(rss2_0)
74