Michal Čihař - Blog Archives for python-gammu

python-gammu has asynchronous wrapper

Yesterday I hacked asynchronous wrapper for python-gammu. It is start of progress to make Wammu behave better while talking to phone. My plan is that all operations will go through this asynchronous wrapper and will be completely non blocking to Wammu. This means no progress bar will pop up to front, but entries will appear in window as they are being read. Progress will be of course still shown, but only in status bar.

The current code is only first step, next thing which has to be implemented in python-gammu are virtual commands. Those will be used for things like getting all calendar events from phone, so all you will have to do for getting all is enqueue GetAllCalendar event and worker will do all for you including progress reporting.

If you want to write own application using this new wrapper, you can look at example which is in sources. It shows all current possibilities, but it will be enhanced in future.

Migration to Subversion completed

Today last batch of Wammu and python-gammu has been converted to Subversion. It was almost painless, it only required lot of CPU time. All project pages should now link to Subversion repositories and snapshots. Also all projects now have publicly available statistics on http://www.ohloh.net and http://cia.vc.

Unfortunately for python-gammu and Wammu are statistics a bit messed up - for Wammu ohloh didn't find license header, which is in almost every file, in python-gammu, doc string comments are not counted as being comments, so without it project has obviously to low comments ratio.

Anyway I was quite impressed by code grow of Wammu in last half year, because I still thing I don't have enough time for Wammu. However if their stats are true, the code amount grows quite fast in last months.

Converting to Subversion

After more playing with Tailor, I managed to hack it enough to convert my Arch repositories to Subversion. Move from distributed to non distributed VCS migth look as step backwards, but I have pretty good reasons for this:

  • Subversion is widely used and there is big chance that potential contributor will know how to use it. This lowers barrier for contributing (especially when compared to current Arch/Bazaar).
  • Subversion sucks much less than CVS which is other well known VCS.
  • If I want to work distributed I can still use Bazaar-NG with foreign branch features.

The conversion is currently on the way and will probably need some time (about half of Gammu revisions have been converted so far).

python-gammu documentation up to date

Today I noticed, that documentation for python-gammu is not up to date, because I completely forgot to update it since 0.13 release.

Well anything what has to be done manually sucks, so I scripted automatic generating of this documentation, so it should always be up to date with current development snapshot.

BTW: Anybody know how to document constructor of class implemented in C using EpyDoc? I didn't manage to find way for this.

VCS conversion troubles

It's probably time to give up. I tried to tweak tailor to make it able to convert my repositories to Subversion for several times, but without any success. It also fails to convert it to Bazaar-NG or Git. Those are list of all VCS I consider to use in future.

I'd prefer to switch to subversion, because it is widely used and most people will be willing to use it, but I have not find any way to convert current VCS data to it. Maybe I will start with empty repository and forget the history.

Version control system for Gammu and others

I still more and more think, that I should move out of Bazaar to some more maintained piece of software for version control. The biggest problem I currently see, that I was not able to convert by Bazaar repositories to some other format. I tried to convert to Bazaar-NG by booth BzrTools and Tailor, but none of them succeeded, then I tried conversion to Git, but Tailor failed also on this task.

Maybe I will try Subversion, which is now very widely used software, although it has some annoyances. I originally wanted distributed VCS, because I was often offline at home, but this is not the case anymore, so using centralised VCS on my own server should not be a big problem.

python-gammu 0.18

python-gammu 0.18 has been just released. New features:

  • Cleaned up build system.
  • Support for crosscompilation using MinGW32.
  • Compatibility with current gammu releases and CMake build system.

python-gammu for Windows

After some playing with distutils to make cross compilation using them possible, I finally gave up. Maybe I did not understand some part of guide, but resulting library only crashes Python.

So I googled once more and I found another approach to cross compile Python extensions for Windows on Linux.

And it was quite simple to do it. First you need Windows installer for Python. Now you need to get dll and includes out of this. I decided to leave hard work on Wine and hoped it will work:

/usr/bin/msiexec /i /tmp/python-2.5.msi

Now you have installed Python somewhere in ~/.wine/drive_c. All what is remaining is tuning of makefiles from original howto. You can also look on code for python-gammu which deals this issue.

Thanks to Matthew Mueller for great howto! BTW: I tested it with Python 2.5 and MinGW 3.4.5.