Home > Uncategorized > and the runner is…

and the runner is…

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: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: