[Tutor] getattr of functions

Negroup - negroup at gmail.com
Thu Nov 24 12:28:03 CET 2005


2005/11/24, Liam Clarke <ml.cyresse at gmail.com>:
> What do you mean enabled?
>
> If it's imported into the namespace you can call it...
>
> Err, can you clarify on the enabling, what context are you using it
> in, and what are you trying to achieve?

Hi, sorry. I'll try to present the actors omitting the details.

table.txt: the first line is an header that lists all the table's
fields. Following lines represent data;

skel.py: it is script that get headers in table.txt and write the
module mymodule.py;

mymodule.py: it is a skeleton where are defined a number of functions.
This number depends on the number of headers, and it may vary
(different table.txt files have a different number of headers, which a
different name too). Each function in the module has the name of an
header.

Finally there is another script, modifiers.py: it imports all the
functions in mymodule and applies these functions to the corresponding
fields.

AS I don't want to apply all these functions indistinctly, I need a
way to mark a function like enabled or disabled. If it is enabled, it
will be invoked. It it results disabled, it won't be called (and thus,
the corresponding field won't be modified).

I don't know if it makes sense to you, I should explain better the
whole flow.. However I don't think it is the right place.

Anyway, I hope the scenario is a bit more free from clouds!

Thanks


More information about the Tutor mailing list