When you start writing hacks like this:
for attr in ['Something1','someThing2'...'SomeThing215']: self.__dict__[attr.lower()+'Widget'].do_something(someValue) self.__dict__[attr.lower()+'Widget'].set_parameter(someparameter)... it's probably time for a subclass.
...and it's probably time to repent as well. How did you get trapped into that mess in the first place? :-D
ReplyDeleteWhen you have to manage 20+ textual fields in one screen, you take all the shortcuts you can find :)
ReplyDeleteNote that I only reduced the hackery, but it's still there and I honestly can't find a better way; it's now something like this:
for item in mysequence: self.__dict__[item+'Entry'] = NewClass(item)