tehmaze/getent — pull request #2 by Karmak23 (2013-04-19 09:24:58+00:00)
Title: Python 3 port, while retaining Python 2 compatibility; flake8 conventions fixes

Hi,
I used `2to3` first, then created small conversion functions and aliases to `c_char_p` to retain compat for python 2 and 3. I use `flake8` on every file save, thus I fixed some syntax conventions or added `# NOQA` on `import *` lines.

I tested on:

- Ubuntu 12.10:
- ipython3 0.13.2 / Python 3.3.0 (in a virtualenv)
- ipython (idem) / Python 2.7.4 (system python)
- OSX 10.8.3:
- ipython (idem) / Python 3.3.1 (in a virtualenv)
- ipython (idem) / Python 2.7.3 (brew system wide installation)

Test code used:
```python
import getent
for g in getent.group():
print (g.name, g.members)
```

This is kind of a small test code, but it seems to cover every important part in the `StructMap`, which handles pretty everything in the end.

I will use this Python 3 port in Licorn 2.0 (http://licorn.org). If I find anything that seems to be a bug in the port I will submit a new pull request.

Regards,