Re: Mass importing of a template based system.. Trouble with name substitutions

2005-08-04 Thread rh0dium
Peter Otten wrote: > rh0dium wrote: > > > for mod in modules: > > a = mod.mod() > > a.run() > > Puzzle: If mod.mod did what you expect, what would a.run have to do to > maintain consistency? I thought that once a = example.example the class is then loaded. Since my framework defines a pyt

Re: Mass importing of a template based system.. Trouble with name substitutions

2005-08-04 Thread Peter Otten
rh0dium wrote: > for mod in modules: > a = mod.mod() > a.run() Puzzle: If mod.mod did what you expect, what would a.run have to do to maintain consistency? There would be no way to determine the name of the module bound to the mod variable, but fortunately the Python developers foresaw y

Re: Mass importing of a template based system.. Trouble with name substitutions

2005-08-04 Thread rh0dium
Hi again, No you're right there isn't a mod.mod I want this to be evaluated from this for mod in modules: a = mod.mod() a.run() to this. for mod in modules: a = example1.example1() a.run() then for mod in modules: a = example2.example2() a

Re: Mass importing of a template based system.. Trouble with name substitutions

2005-08-03 Thread Robert Kern
rh0dium wrote: > Hi all, > > Basically I have a bunch of pluggins in a directory (METDIR). For each > one of these templated pluggins I want to do a specific routine. Let's > start with a basic template > > file example1.py > > class example1: >def __init__(self): > pr

Mass importing of a template based system.. Trouble with name substitutions

2005-08-03 Thread rh0dium
Hi all, Basically I have a bunch of pluggins in a directory (METDIR). For each one of these templated pluggins I want to do a specific routine. Let's start with a basic template file example1.py class example1: def __init__(self): print "Initialize" def run(self):