Changeset 206
- Timestamp:
- 22-04-07 22:22:43 (6 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
-
ChangeLog (modified) (1 diff)
-
moap/command/doap.py (modified) (3 diffs)
-
moap/doap/Makefile.am (modified) (1 diff)
-
moap/doap/rss.py (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r205 r206 1 2007-04-22 Thomas Vander Stichele <thomas at apestaart dot org> 2 3 * moap/command/doap.py (Rss, Rss.addOptions, Rss.handleOptions, Rss.do, 4 Show, Doap, Doap.handleOptions): 5 * moap/doap/Makefile.am: 6 * moap/doap/rss.py (doapsToRss, createdToPubDate, cheetah_toRss, 7 genshi_toRss): 8 Add RSS feed generation based on Genshi or Cheetah templates. 9 1 10 2007-04-22 Thomas Vander Stichele <thomas at apestaart dot org> 2 11 -
trunk/moap/command/doap.py
r197 r206 297 297 return 0 298 298 299 class Rss(util.LogCommand): 300 description = "Output RSS 2 feed from project releases" 301 302 def addOptions(self): 303 self.parser.add_option('-t', '--template-language', 304 action="store", dest="language", 305 help="template language to use (genshi/cheetah)") 306 307 def handleOptions(self, options): 308 self._language = options.language or 'genshi' 309 310 def do(self, args): 311 from moap.doap import rss 312 template = None 313 314 # if one is specified, prefer it 315 if args: 316 # FIXME: maybe find a default one based on the doap name ? 317 # like .doap -> .rss2.tmpl ? 318 path = args[0] 319 try: 320 handle = open(path) 321 template = handle.read() 322 handle.close() 323 except: 324 self.stderr.write("Could not read template %s.\n" % path) 325 return 3 326 self.debug("Using requested template %s" % template) 327 328 # if one can be found close to the .doap file, use it 329 330 print rss.doapsToRss([self.parentCommand.doap, ], template, 331 templateType=self._language) 332 299 333 class Show(util.LogCommand): 300 334 description = "Show project information" … … 332 366 usage = "doap [doap-options] %command" 333 367 description = "read and act on DOAP file" 334 subCommandClasses = [Freshmeat, Ical, Mail, Show, bug.Bug]368 subCommandClasses = [Freshmeat, Ical, Mail, Rss, Show, bug.Bug] 335 369 336 370 doap = None … … 363 397 364 398 return 365 366 399 367 400 for p in self.paths: -
trunk/moap/doap/Makefile.am
r35 r206 4 4 __init__.py \ 5 5 common.py \ 6 doap.py 6 doap.py \ 7 rss.py
Note: See TracChangeset
for help on using the changeset viewer.
