slacklog

Convert Slackware ChangeLog to RSS
Download

slacklog Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL v3
  • Publisher Name:
  • Mikko Varri

slacklog Tags


slacklog Description

Convert Slackware ChangeLog to RSS slacklog is a Python library to convert a Slackware ChangeLog into other formats. Currently, RSS is supported. Typical usage of the program looks like this:slacklog2rss --changelog slackware-current/ChangeLog.txt \--encoding iso8859-1 \--out ~/public_html/slackware-current.rss \--slackware "Slackware current" \--rssLink "http://linuxbox.fi/~vmj/slackware-current.rss \--description "Slackware current activity" \--managingEditor "vmj@linuxbox.fi (Mikko Värri)" \--webMaster "vmj@linuxbox.fi (Mikko Värri)"The included Python library provides the ability to make custom formats easily::#!/usr/bin/env pythonimport codecsimport localefrom slacklog import parsersdef read(file):'''Return file contents as Unicode.'''return codecs.open(file, 'r', 'iso8859-1').read()def write(str):'''Print out in preferred encoding.'''print str.encode(locale.getpreferredencoding())# Parse the ChangeLoglog = parsers.SlackLogParser.parse(read('ChangeLog.txt'))# Print a custom formatfor entry in log.entries:write(u' %s\n' % (entry.timestamp.isoformat(), entry.description))for pkg in entry.pkgs:write(u'%s:%s' % (pkg.pkg, pkg.description))Note that slacklog package deals solely in Unicode; parser expect to be given Unicode input and formatters generate Unicode data.Installation:Use either "pip install slacklog" or download the source archive and use "python setup.py install".The source code is available at `Python Package Index (PyPI) or, if you want the unreleased version, from `Github git repository. Requirements: · Python What's New in This Release: · Packaging cleanups.


slacklog Related Software