Login

New project in sight

Written on 2009-08-04 08:32.

I now have some time and after some holidays the need to code new stuffs is back.

The lamson project (a python SMTP framework) seems quite interesting. It might be my new pet project since I have a need for a customizeable SMTP server. It might also be the good starting point for the PBEM/Internet version of Carcassonne I always wanted to do.

Our trac is more welcoming now

Written on 2009-04-17 15:49.

Since we released a new version of relatorio (our openoffice templating tool if you never heard of it) yesterday, I took this opportunity to install trac's account manager plugin. It was surprisingly easy (I had memories installing the mercurial plugin where I had to debug the code and so on) and works like a charm !

So from now on you can register yourself on our trac and use your own login/password to login, which means you can get notifications when there are changes on content you are monitoring.

PS: On a side note, I started toying with the whole microblogging stuff, you'll find me on identi.ca.

relatorio is available to debian users

Written on 2009-03-09 09:14.

I am quite happy to inform you that relatorio is now packaged in the debian distribution !

We should make a release quite soon, since there is a bug fixing a huge regression on py:when tags.

relatorio 0.5 is released

Written on 2009-01-23 13:23.

I'm quite happy to announce the new release of relatorio. Thanks to the sponsoring of b2ck, we added some nice features such as looping on columns in OOTemplates and the improvements in the closing/opening tag detection algorithm, many thanks to them !

Here is the full changelog:

  • Added Text and XML Template to the TemplateLoader
  • Splitted mimetypes and ids in the ReportRepository
  • RelatorioStream now has a __str__ method
  • OOTemplate: ChartTemplate can be included
  • OOTemplate: Correctly handle content type in the table cells
  • OOTemplate: Better closing/opening tag detection algorithm
  • OOTemplate: Looping on columns now work in OOTemplates
  • OOTemplate: Using compression

And here is a screenshot of the looping feature:

Loops on columns work now !

Well the colours are not great but I'm not the one to blame !

import skynet

Written on 2008-12-24 10:31.

So here is my modest skynet module proposition to avoid an xkcd's like disaster:

import sys; print 'Not a good idea'; sys.exit(0)

And here it is in action:

kinder:~ % python                                                        #10005
Python 2.5.2 (r252:60911, Nov 14 2008, 21:49:10)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import skynet
Not a good idea
kinder:~ %

A merry whatever-mas to all of you !

Some relatorio documentation love

Written on 2008-11-23 16:45.

With the recent release of tryton, I felt the need to give the relatorio website some love. Thus I added some documentation and Ged created a logo and a favicon.

relatorio logo

At least now, people will not need to dig into the examples directory to know how to generate odf files from their python objects.

Do not hesitate to report bugs and misfeatures in the documentation.

Inheritance-aware dictionnary

Written on 2008-11-14 11:21.

In our framework we are using a dictionnary that stores the views available for a model. But what happens if you still want to provide a view for a subclass of a model ?

Of course there is still the default view created through introspection but they are only good-looking for very simple models. Thus, in this case, we decided to provide the view from the inherited parent.

Here is the code for an inheritance-aware dictionnary class.

class ClassDict(dict):
   """A dictionnary subclass that uses classes as keys
   >>> class A(object): pass
   >>> class B(object): pass
   >>> class C(B): pass
   >>> class D(A, C): pass
   >>> class E(D, B): pass
   >>> a = A(); b = B(); c = C(); d = D(); e = E()
   >>> test = ClassDict()
   >>> test[A] = 'A'
   >>> test[D]
   'A'
   >>> try:
   ...    test[b]
   ... except KeyError:
   ...    print 'Yep'
   Yep
   >>> test[B] = 'B'
   >>> test[E]
   'A'
   >>> test[C]
   'B'
   >>> test[c]
   'B'
   >>> del test[A]
   >>> test[d]
   'B'
   """
   def __getitem__(self, key):
       if not isinstance(key, type):
           key = key.__class__
       found = False
       for class_key in key.__mro__:
           try:
               val = super(ClassDict, self).__getitem__(class_key)
               found = True
               break
           except KeyError:
               pass
       if found:
           return val
       raise KeyError
   def __setitem__(self, key, value):
       if not isinstance(key, type):
           key = key.__class__
       super(ClassDict, self).__setitem__(key, value)

This kind of dictionnary will only accept new-style classes, moreover if you use an instance as a key, it will use as the key the class of this instance.

Phrase from nearest book meme

Written on 2008-11-13 07:57.

Meme from Kees:

  1. Grab the nearest book
  2. Open it to page 56
  3. Find the fifth sentence
  4. Post this sentence on your blog along with these instructions
  5. Don't dig your favourite book, the cool or intellectual one: the closest.

« On va en manger tous les deux, d'accord ? » - Pandore menacée, Peter F. Hamilton

We are moving faster now ...

Written on 2008-11-06 15:05.

A few weeks ago we reached a nice milestone in the development of our own web application framework : openhexperience., and I did not even think to blog about it.

But first let me introduce openhexperience. This framework is constructed from the experience we have gathered once we were working at Tiny. There we worked on TinyERP (now OpenERP), but we did not want to make the same mistakes that we thought were made in this piece of software. So we decided to rewrite it from the ground up using all the nice goodies the python ecosystem provides and if necessary create the missing pieces.

Gaëtan worked on elixir (a thin layer on top of SQLAlchemy) so that we have an abstracted and easy to use layer on top of the database world. I created relatorio and now we can generate pretty reports. We are using genshi to generate the xml views that are sent to the client. The glue between all the components being a cherrypy server with a custom dispatcher so that we can access the resources in a REST way. To handle translations we opted for the UNIX approach of using gettext, this was made easy by babel and the translator filter of genshi. To all the contributors of all those projects, I have to give a big kudo : your code is a great source of inspiration.

To build our client, we choose the AJAX framework qooxdoo to have a cross-OS, easily deployable solution.

And as I said earlier we reached a nice milestone quite recently because for the first time, we began to mix all the pieces together and so here is the first screenshot:

The openhexperience client running in midori and connecting to the server

For now, we still have a lot of work to do to reach a releasable state (some crucial features are yet to be done or integrated, there is no documentation yet, there are not nearly enough showcase modules, etc.), but it begins to look good and we are quite satisfied with the choices we did so far.

If you ever want to try out our framework the sources are available in our mercurial repository.

List of programming languages I know

Written on 2008-09-09 22:20.

I will follow Corey's example and make the ordered list of the programming languages I learned in the past 15 years

  1. LOGO
  2. QBASIC
  3. pascal
  4. C
  5. scheme
  6. Java
  7. lisp
  8. prolog
  9. shell
  10. python
  11. VBScript
  12. javascript
  13. erlang

I am still deeply in love with every functional languages I learned. I was in fact directed to Python (circa 2001) by some guy in a Scheme usenet group telling me that if I wanted a more market-friendly language but still elegant I should learn Python.

Pages :