Wednesday, August 13, 2008

Cassopi testing

Today I wrote a tiny script that helps me to handle testing easier. Originally each file to be tested had to contain following block at the end (Does someone know if blogspot has code block btw?):

# enable contract checking
import contract
contract.checkmod(__name__)

def _test():
import doctest
return doctest.testmod()

if __name__ == '__main__':
_test()

Of course it's not much code but nevertheless on longer term it would just get annoying to add that to the end of almost each file. Also extending it would be somewhat nasty as you would have to edit all files containing it.

Therefore I ended up writing a simple script that can be executed at the root of Cassopi source (/cassopi/). You just type "./tester.py modulename" and it runs contract tests (if contract module is available) and doctests. I might add coverage testing there later but at the moment I am happy with those two. You can find the script at http://code.google.com/p/cassopi/source/browse/trunk/cassopi/tester.py .

I also found a great page containing more documentation for the contract module. Check out http://people.cs.uchicago.edu/~knorby/pycontract-doc/ .

Tuesday, August 12, 2008

Cassopi development site open

After a break (half a year!) I have resumed the development of my sketching application previously known as Jade. I decided to begin hosting the application on code.google.com . When registering the application I found out that a project named Jade already exists. That's why I renamed the project Cassopi. The new project site can be found at http://code.google.com/p/cassopi/ .

I will spend this month developing it. In the first stage I aim to get basic user interface working. This is quite a bit of work as I started from scratch using pyglet, pyopengl and OpenGL. I am not an expert at OpenGL so this works as a learning experience as well. I already have simple implementation of multiple viewports working already. :)

Here's a screenshot. Note that it's not perfect due to double buffering I think. This is something pyglet provides and I am not sure if there is anything I can do about it yet. It's not a priority issue anyway.