Wednesday, July 8, 2009

What I've done so far.

Mithro asked me to write a summary of what I've done so far in GSoC, so here I go:

I started on the xstruct module (an improved version of Python's struct module), as it did not depend on any other modules but was used by much of the rest of the library. My work here was mostly writing unit tests as xstruct was not a new module, but I did find flaws in a number of types wihch I presume simply hadn't been tested. This included incorrect unicode support for string encoding and floating-point types having been overlooked entirely.

After that I began work on the structures module. This module is something of a high-level wrapper of xstruct. It provides a kind of type-safe way to represent the structures of xstruct. I of course wrote unit tests for this, which uncovered quite a lot of bugs throughout that needed to be addressed. The bulk of code changes were in the Group and List structures, as they represented mutable and nestable types. These were in a pretty unusable state, but now do exactly what they're supposed to do. 

In the last few weeks I've been working on the parser module of libtpproto2-py. This module  is an XML parser which reads the protocol.xml file that specifies  the Thousand Parsec protocol, and generates classes representing all the kinds of packets that might be transmitted. This module required quite a lot more work. The parser was SAX-based and took me a lot of work to be able to follow. Because a primary goal of libtpproto2-py is readability, I rewrote the parser from scratch using a DOM approach which I find to be much more readable. The previous parser also was incomplete in its parsing of protocol.xml. Most notable is that it had no support for parameters, which are used by the server to specify custom objects and orders for the game being played. Getting full parameter support has been the last major feature I've completed.

No comments:

Post a Comment