Hi Steven. Looking at your code, why are you naming the value __all__? It looks like a built-in variable?
Unless there is an automatic way to correctly get the function list, I will probably be better off giving the lines sequence numbers, and generating the function list from that. Steve. "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 06 Sep 2007 15:44:57 +1000, > "bambam" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Try something like this: define a module holding the device functions. > > # module script > > __all__ = [a0010, a002, a0030, a0040, a0050] > ... # module test1 import script class Test1(pl_test.Pl_test) """ADC calibration and Battery Voltage calibration""" def run(self,devlist): for line in script.__all__: for self.dev in devlist if self.dev.active and not self.dev.failed try line(self) except Exception,e: print e self.dev.active=False print "The following devices passed:" for dev in devlist if dev.active and not dev.failed print dev print "The following devices need to be re-tested" for dev in devlist if not dev.active print dev print "The remaining devices failed" for dev in delist if dev.active and dev.failed print dev > -- > Steven. > -- http://mail.python.org/mailman/listinfo/python-list