<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Feb 1, 2012, at 3:35 PM, Arnaud Delobelle wrote:</div><blockquote type="cite"><p>On Feb 1, 2012 9:01 PM, "Russell E. Owen" <<a href="mailto:rowen@uw.edu">rowen@uw.edu</a>> wrote:<br>><br>> I have an odd and very intermittent problem in Python script.<br>> Occasionally it fails with this error:<br>><br>> Traceback (most recent call last):<br>>  File<br>> "/Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas<br>> eFocusScript.py", line 884, in run<br>>  File<br>> "/Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas<br>> eFocusScript.py", line 1690, in initAll<br>> TypeError: unbound method initAll() must be called with BaseFocusScript<br>> instance as first argument (got ScriptClass instance instead)<br>> self=<ScriptClass object at 0x2066b410>; class hierarchy=[(<class<br>> 'TUI.Base.BaseFocusScript.ImagerFocusScript'>, (<class<br>> 'TUI.Base.BaseFocusScript.BaseFocusScript'>,)), [(<class 'ScriptClass'>,<br>> (<class 'TUI.Base.BaseFocusScript.ImagerFocusScript'>,))]]<br>></p><p>Looks like you have loaded the same module twice.  So you have two versions of your class hierarchies. You can check by printing the ids of your classes. You will get classes with the same name but different ids.</p><p>Arnaud<br></p></blockquote></div><div>Yes! I was reloading BaseFocusScript. Oops.</div><div><br></div><div>In detail: script files are dynamically loaded when first requested and can be reloaded for debugging. I think that's safe because script files are self-contained (e.g. the classes in them are never subclassed or anything like that). But I went too far: I had my focus scripts reload BaseFocusScript, which is shared code, so that I could tweak BaseFocusScript while debugging focus scripts.</div><div><br></div><div>Thank you very much!</div><div><br></div><div>-- Russell</div></body></html>