Michal Čihař - Blog Archives for English

Expert Python Programming

The book Expert Python Programming comes with subtitle Best practices for designing, coding, and distributing your Python software. Well this seems to be quite broad area to be covered by a single book, but the book really tries to cover all topics at least in some form of overview and pointing user to other documentation sources.

Expert Python Programming

In first chapter you can find information about installing Python on various platforms. As the book seems to be targeted to more experienced users, this chapter seems to be a bit useless, but author decided to give a chance also to users, who do not know the basics.

Next chapters describe best practices for writing Python code, which was the most interesting part for me. I use Python several years, but I never really found time time to properly look at using decorators, generators and other "recently" introduced language features. Second chapter nicely covers these and I really appreciated that I got idea for what decorators can be used.

Third chapter into class level and describes how to use metaclasses, attributes, constructors and other things you can face on class level. Fourth moves the topic to even more abstract way and in short summarises PEP 8 best coding practices.

Here we leave solid ground of writing code and we move to more abstract areas of managing projects, testing, documenting and distributing software. It begins with description of distutils and setuptools in chapters five and six, where you will find basic information about distributing your software. Seventh chapter covers zc.buildout, which can help you with setting up and deploying applications in way Zope and Plone do.

Next chapter is not really related to Python, it just describes advantages of version control. The most Python related part is using Mercurial VCS, which is written in Python, but you can of course use it for managing any project.

Next tree chapters are devoted to project development in general, describing management of the project, generating documentation for project using Sphinx (what actually made me into starting documentation for python-gammu in it) and test-driven development practices.

Now comes again two more interesting chapters describing optimization of Python code, giving the best advice not to optimize unless you are sure it is needed ;-). But it also goes more deeper and describes benchmarking procedures, how to debug memory usage and some basic tips for general things which might improve performance.

Last chapter is some kind of extra in the book and to me it looks it was added just to use buzzwords design patters, but well it is there and it covers few design patterns which might be useful in Python like singleton or more advanced version of it called borg.

In general this book covers quite wide range of topics, what can be seen as biggest advantage and disadvantage. You will get basic overview of creating Python project using modern methods (test driven development, design patters, best practices for Python code), but you can not expect it will go into much deep details.

The book can extend your knowledge of development in Python, but you should carefully check examples with errata, because otherwise several of them will fail. I'm not that good at spotting problems in written English (as you can probably see in this post), but I spotted several errors in code and I think more careful editor work on the book would improve my feelings a bit. Also I personally would prefer much deeper look into some topics and skipping the others, but one book can not fit all ;-).

New chance for S60 3rd Edition

While debugging some problems one user reported with Nokia 6220 Classic, I noticed that recently introduced fbususb connection type somehow works with recent Symbian Nokia phones. This might be interesting way to go (instead of porting gnapplet), I never thought of possibility that Nokia has implemented something really backward compatible in their Symbian phones, let's see whether it can actually be used for something useful.

Gammu test version 1.23.90

It looks like I'm definitely losing Monday release schedule, but it does not matter that much, new release is here anyway. I wanted to push some bigger changes into first testing release after 1.23, but instead of that I did bunch of bug fixes, documentation and test improvements.

Full list of changes follows:

  • Fixed decoding of Samsung memory entries.
  • Properly handle corrupted messages from Nokia phones (bug #811).
  • Fix parsing of calls from Alcatel C701 (bug #831).
  • Fixed handling of error states with -len and -autolen parameters.
  • Fixed possible crash in DBI engine.
  • PostgreSQL engine properly uses sequences instead of reinventing.
  • MySQL engine properly uses auto increments instead of reinventing.
  • Fix escaping of field name in PostgreSQL engine.
  • Better SMSD files logging.
  • Added testing of SMSD files engine.
  • Increase timeout for AT settings SIM card SMS storage.
  • Fixed date formatting in PostgreSQL SMSD service.
  • Add option to install without documentation.
  • Add -textutf8 option for TEXT sms.
  • Fix crash when some lines in config are too long.
  • Make smsdrc example better looking by removing obsolete docs.
  • Make dku2 connection types work on Linux (alias to fbususb).
  • Better calculation of signal percent.
  • Fixed getting of memory status for some Nokias (bug #836).

You can download from usual place: http://cihar.com/gammu/,

Debian users will find packages in experimental soon, SUSE, Fedora and Mandriva users can check experimental repository in OpenSuse Build Service.

Summer of Code for Gammu

After some thinking I've just filled in application for Gammu in Google Summer of Code 2009. I feel the project is recently getting some boost and it would be great if some students would help us with new ideas.

On the other side I'm afraid that chances to get accepted for such a small project is quite limited, but if you have some great ideas which could be implemented as a summer project, feel free to add them to our wiki, maybe they will attract somebody :-).

Ideas page: http://www.gammu.org/wiki/index.php?title=Gammu:GSoC2009

Wammu 0.30.1

Unfortunately Wammu 0.30 was not running on some Windows versions, so here comes fixed one. There is no need to update if you did not use Windows binaries. Full list of changes:

  • Fixed Windows build.
  • Fixed typo in desktop file.
  • Fixed spec file.

Wammu 0.30

I just released version 0.30 of Wammu. This release fixes various problems found by users. Full list of changes:

  • Do not fail if group ID can not be converted to name.
  • Updated to work with current python-gammu.
  • Translation updates.
  • Support for displaying picture on contacts.
  • Properly handle paths with special chars (bug #816).
  • Make build time dependency checks optional.
  • Drop wxPython 2.4 compatibility code.

This release also comes with binary for Windows with embedded Gammu 1.23.1.

Thought about email footers

Have you ever thought what you send in email footer?

The information contained in this e-mail is private & confidential and may also be legally privileged. If you are not the intended recipient, please notify us, preferably by e-mail, and do not read, copy or disclose the contents of this message to anyone.

If I'm not the intended recipient (supposing I know how to guess this), how am I supposed to notify you, when I should not read the contents, so I should not know about fact that I should notify you?

Summer of Code in phpMyAdmin

After quite successful debut in Google Summer of Code last year (even not directly, but though MySQL project), where both projects ended quite successfully and brought great addition to our code base, it's time to try to get again on the track. Hopefully we will manage to be direct participants this year.

If you have some great ideas which are missing in phpMyAdmin, feel free to fill them either in feature tracker or directly into our ideas page.

Gammu stable version 1.23.1

After recently introduced tradition, I again come with bugfix update for 1.23.0 called 1.23.1. This time there is no critical fix as in 1.22.1, but few fixes, which might annoy users, for example forgotten installation of gammu-smsd-monitor tool.

Full list of changes:

  • Documentation clarification.
  • Translations update.
  • Actually install gammu-smsd-monitor.
  • Fix recording received messages count for MySQL.
  • Fix SMS location handling for Huawei E160 (bug #825).
  • Do not probe for MPBR support all the time.

You can download from usual place: http://cihar.com/gammu/,

Debian users will find packages in unstable soon, SUSE, Fedora and Mandriva users can check repository in OpenSuse Build Service and Ubuntu in my PPA.

Fun with software catalogues

Recently, I made available information about Gammu and Wammu in machine readable formats (currently DOAP and PAD). In order to fully use advantage of PAD, I decided to push both Gammu and Wammu to some PAD enabled sites I found. At least it should give it a bit more visibility in Windows world.

When I started looking for these sites, I was surprised that there is so much of them. Yes it is quite easy to setup such site as ASP provides PHP scripts to make such site, but I expected that people would be a bit sane and would not start 1001th software catalogue. But anyway, let's submit my software there to spread the world a bit ;-).

The important site (at least as far as I remember them from times when I was using Windows) like Tucows or cnet downloads, have some lengthy review process, what is okay for me. But more funny are random small sites, where you immediately get 5/5 stars or sticker 100% Vista Compatible. Who cares, let's see if it will really attract some users.