Piotras' blog: Archive
2007-11-01 - 2007-11-30
libmidgard and debug symbols
Posted on 2007-11-09 12:51:47 UTC.
I just improved debian files for midgard-core so upcoming Midgard 1.8.5 release will provide new package among debian ones. midgard-core debian files describe new libmidgard9-dbg package which is nothing but libmidgard9 without stripped binary code.
Why do we need yet another package for midgard? It's simple. When something really bad happens, for example segfault or sigabort, you do not have to recompile midgard library to debug it with gdb or valgrind. Instead, you will be able to install libmidgard9-dbg package with apt-get.
As 1.8.5 is not yet relesead, I built debug package for 1.8.4.
More events in Midgard 1.9
Posted on 2007-11-14 11:52:30 UTC.
Last week I fixed loaded event issue. Well... I am not sure if I can say I fixed it because of its complexity. Basically it's chicken or egg problem, but at least I added action_loaded signal in midgard-core and added emit method for all MgdSchema classes.
Simply I implemented method which is registered as GObjectClass' one. PHP itself doesn't provide any events functionality, and semi event pure php patches provides method like 'RaiseEvent' , while GTK-PHP bindings ( which unfortunatelly includes GObject bindings ) doesn't implement it at all. It's not private method, it's public one so objects itself can emit a signal if programmer really want it. It's mostly matter of convention and application stability.
Midgard-php developers can do the same. Write own events' callbacks or emit any signal if it's needed.
Example code would lokks like this:
$qb = new midgard_query_builder("my_class");
$ret = $qb->execute();
$obj = $ret[0];
$obj->connect("action_loaded", "my_callback_function", $params)
if($obj->creator = $myself)
$obj->emit("action_loaded);
More beauty for Midgard
Posted on 2007-11-19 13:01:28 UTC.
It was spring when I wrote about python bindings for Midgard. While then, it was very initial work, today, I must say we have something really working, just after few days of work.
So as of today, you can do:
midgard_config
- read midgard unified configuration
- list all possible midgard configurations
- write configuration
midgard_connection
- open connection by its name
- open connection using specified configuration
- set application's sitegroup context
- set application's language context
MgdSchema objects are also implemented so those are automagically registered as python classes when module is imported.
- Added methods
- get_by_id
- get_by_guid
- create
- update
- delete
- purge
- is_in_parent_tree
- is_in_tree
- get_parent
- parent
- list
- list_children
- get_languages
- get_by_path
You can find test code in midgard-python directory. Of course, python bindings require midgard2 library.