Archive

Posts Tagged ‘xml’

how to create a glade store

29 October 2008 Leave a comment

unfortunately, guys at pygtk haven’t thought about a solution about making persistent GUIs. This means that, at your next graphical application restart, you will get the initial window size and settings. And with initial, I mean the design ones.

In the last few days, I have developed a small class to store sensible informations: gladeStore. This class is instanciated just on the application ‘destroy’ event, and its job is to save all the listed properties for all the widgets belonging to your application.

It works without problems on a small test application. I will be bughunting on Gino the next few days.

BTW: Gino interface has been redesigned just today. And XMLTreeView supports the ‘tail’ of XML nodes, for the sake of completeness 🙂

Advertisements

news from the SVN

3 October 2008 Leave a comment

this week’s edition of “news from the SVN” follows:

– XMLFinder: a graphical xpath evaluator (PyGTK)
– XMLFindTool and XMLTreeView: two classes which implement the Gino and XMLFinder cores; XMLFinder uses both the classes
– something doesn’t work in the CompressedFile class; under investigation

no binary distributions of these tools are provided, for now

notice: we have moved, once more. this blog is now available also on tec.nilleb.com

and the runner is…

28 May 2008 Leave a comment

well, in the spare time I have coded the software which has been in my wishlist for a few weeks: the runner.

runner.py is a small program which takes an xml configuration file as input, manages the actions defined for each item in this configuration and checks that they’ve correctly been performed.

in a couple of lines (they’re almost the same in python):

configuration = parse(xmlsource)
for priority in configuration.priorities:
    play(priority)
    windup(priority)

and play is like the following

for each operation in configuration.operations[priority]:
    eval("self."+operation.get('type') + "(operation)")

and the windup is like the following

for each operation in configuration.operations[priority]:
    eval("self."+operation.get('type') + "(operation)")

voila, c’est tout.

Categories: Uncategorized Tags: , , ,

use an xml file as a python dictionary

23 May 2008 Leave a comment

well, I wanted something like this, to manage a configuration file.

I have done this today, in python. It seems to work with ElementTree and lxml.

It’s available on the assembla SVN, I’ll probably search a way to publish it elsewhere on the net, too.

I don’t think it’s complete, but it’s a beginning. It’s also full of things to fix, handle in a better way, and so on.