log entry 2013-08-12

git-buildpackage creates iptables-converter.deb v0.9.1

The tests done by tox did not show any errors, unfortunately the iptables_converter.py was not tested with python3 by misconfiguration of tox. The configuration for tox environment py32 had to prepare the python3 code. This led to some investigations, calling 2to3 and manual modifications of the code. Especially the import UserDict had to be modified, as in python3 there is no longer UserDict available directly. It was moved to collections and so the import now comes in two versions depending on the first fails or not:

try:
    from UserDict import UserDict
except ImportError:
    from collections import UserDict

This now works for python 2.6, 2.7 and 3.2, which all are available in the Debian wheezy universe nowadays.

The print statements had to be modified as well, a template was found by using 2to3. The genius python creators have put some forward compatibility into the 2.6 and 2.7 versions to understand the modified python3 syntax of print as well. So this is easy going:

print "COMMIT"
print "# generated from: %s" % (fname)

became:

print("COMMIT")
print("# generated from: %s" % (fname))

As this syntax is compatible to both python2 and python3, it is preferred now.

Documentation is now delivered as a separate debian package. It is written as reStructuredText and converted to HTML by sphinx. Beautiful.

So the git log comes quite short:

commit 47c4b01875e29ad90fdecd306fb58b7b89862213
Author: Johannes Hubertz <johannes@hubertz.de>
Date:   Sun Aug 11 23:38:12 2013 +0200

    gbp dch did the changelog

commit aadc8a376605efc1936b8c70e17ba1b06a4303a1
Author: Johannes Hubertz <johannes@hubertz.de>
Date:   Sun Aug 11 23:36:32 2013 +0200

    v0.9.1: tests are enhanced and rewritten, python3.2 now works

    iptables-converter.py now compatible to python2.6, 2.7 and 3.2
    Makefile: has new targets: rpm and deb
    rpm is build py pyhton setup bdist_rpm
    deb is build by git-buildpackage and pbuilder
    deb creates two packages, binary and doc.
    sphinx-config is adapted to test requirements
    unittests are numbered now and show classname

Debian flavor packages of the iptables-converter are available, rpm flavor may be found as well.

Have fun!

social