Giter VIP home page Giter VIP logo

slacklog's Introduction

Download Build Status Docs

slacklog provides programs and a library to convert a Slackware ChangeLogs into other formats. Currently, RSS, Atom, JSON, and PyBlosxom formats are 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 "[email protected] (Mikko Värri)" \
               --webMaster "[email protected] (Mikko Värri)"

The included Python library provides the ability to make custom formats easily:

#!/usr/bin/env python
from __future__ import print_function
import codecs
import locale
from slacklog.parsers import SlackLogParser

def 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 ChangeLog
log = SlackLogParser().parse(read('ChangeLog.txt'))

# Just an example of walking the log tree and print it out
for entry in log.entries:
    write(u'[%s] %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 expects to be given Unicode input and formatters generate Unicode data.

In addition to Python, python-dateutil is required.

Python versions 2.7 and 3.4 - 3.7 are tested, together with python-dateutil versions 2.1 - 2.8.

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.

Here's one way to hack on this inside a container:

$ docker run --rm -it -v $(pwd):/slacklog -w /slacklog python:3.7-alpine3.8 sh
# apk add --no-cache curl
# pip install python-dateutil==2.7.3
# python setup.py install
# sh examples/fetch-changelogs.sh
# sh examples/update-slacklog-rss.sh

Obviously, you need Docker installed and working, and I'm assuming you run those commands in the git clone.

Original author and current maintainer is Mikko Värri ([email protected]).

slacklog is Free Software, licensed under GNU General Public License (GPL), version 3 or later. See LICENSE.txt file for details.

slacklog's People

Contributors

vmj avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

slacklog's Issues

GTK+ is not recognized as a package name :P

E.g.

+--------------------------+
Thu May 11 18:09:15 UTC 2017
l/gtk+3-3.22.14-i586-1.txz:  Upgraded.
+--------------------------+

Parses as zero packages and the gtk update in the entry description.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.