[Pypentago-devel] New hooks system.
Status: Pre-Alpha
Brought to you by:
segfaulthunter
From: Florian M. <flo...@ai...> - 2008-07-27 22:02:53
|
Good day, Locally, I have been reimplementing the connection between the network interface and the graphical interface using simple variables that the GUI assigns functions or methods to, which are called when needed. Although this works pretty well, we might have scalability issues, because this rather limits us later on when we want to bind multiple handlers to one actions. Of course a workaround would be to write and pass a function that calls all of these handlers, but this is rather hacky. So I have been developing a 'hooks' module, which I am probably going to rename to 'actions' or 'handlers', to make it more clear what it does. For more informations of this terminology please see 'hooks.py' in trunk/src/pypentago. This module allows us to bind multiple handlers to one event. I have been trying to put a lot of design in it, although it might not seem so at a first glance at the source code. It is difficult to let both the registrar and the emitter pass data to the handler, but I think I have chosen a system that should work. Nevertheless it is still work in process and I think that I will change the API some times, if I think it would be better. Best regards, Florian Mayer -- GPG Key ID: BC0FFB31 Blog: http://segfaulthunter.blogspot.com/ |