{ "info": { "author": "Christopher Arndt", "author_email": "chris@chrisarndt.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: TurboGears", "Framework :: TurboGears :: Widgets", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Turbofeeds is a TurboGears_ 1 extension which provides support for generating\r\nRSS and Atom feeds and matching display widgets.\r\n\r\nTurboFeeds was formerly the ``feed`` sub-package of the main TurboGears\r\ndistribution. It was extracted from the TG core to ease updating, enhancing,\r\nand maintaining both projects.\r\n\r\nTurboFeeds is mostly backwards-compatible with the ``turbogears.feed``\r\npackage, but has lots of fixes and a few new features, most importantly support\r\nfor Genshi templates. It works with both the TurboGears 1.0 and the 1.1 branch.\r\n\r\n\r\nInstallation\r\n------------\r\n\r\nTo install TurboFeeds from the Cheeseshop_ use `easy_install`_::\r\n\r\n [sudo] easy_install TurboFeeds\r\n\r\nThis requires the setuptools_ package to be installed. If you have not done so\r\nalready, download the `ez_setup.py`_ script and run it to install setuptools.\r\n\r\nIf you want to get the latest development version, you can check out the\r\ntrunk from the `Subversion repository`_ with::\r\n\r\n svn co http://svn.turbogears.org/projects/TurboFeeds/trunk TurboFeeds\r\n\r\nFor bug reports and feature requests, please go to the TurboGears trac at\r\nhttp://trac.turbogears.org/.\r\n\r\nTo open a ticket, you'll need a trac account. Please select \"TurboFeeds\" as the\r\nticket component.\r\n\r\n\r\nUsage\r\n-----\r\n\r\nController::\r\n\r\n from turbogears import controllers, expose\r\n from turbofeeds import FeedController, FeedHeadLinks, FeedLinks\r\n\r\n class MyFeedController(FeedController):\r\n def get_feed_data(self, **kwargs):\r\n entries = []\r\n # Fill ``entries`` with dicts containing at least items for:\r\n #\r\n # title, link, summary and published\r\n #\r\n # For example, supposing ``entry`` is a database object\r\n # representing a blog article:\r\n entries.append(dict(\r\n title = entry.title,\r\n author = dict(name = entry.author.display_name,\r\n email = entry.author.email_address),\r\n summary = entry.post[:30],\r\n published = entry.published,\r\n updated = entry.updated or entry.published,\r\n link = 'http://blog.foo.org/article/%s' % entry.id\r\n ))\r\n return dict(entries=entries)\r\n\r\n class Root(controllers.RootController):\r\n feed = MyFeedController(\r\n base_url = '/feed',\r\n title = \"my fine blog\",\r\n link = \"http://blog.foo.org\",\r\n author = dict(name=\"John Doe\", email=\"john@foo.org\"),\r\n id = \"http://blog.foo.org\",\r\n subtitle = \"a blog about turbogears\"\r\n )\r\n feedlheadinks = FeedHeadLinks(controller=feed)\r\n feedlinks = FeedLinks(controller=feed,\r\n title = \"Click link to access the feed in %(type)s format\")\r\n\r\n @expose('.templates.mypage')\r\n def mypage(self):\r\n return dict(\r\n feedheadlinks=self.feedheadlinks,\r\n feedlinks=self.feedlinks)\r\n\r\nTemplate::\r\n\r\n
\r\n ${feadheadlinks()}\r\n ...\r\n \r\n \r\n