PDA

View Full Version : Exception in module vizjoy


fordprefect
11-29-2012, 03:27 AM
Dear all,

while modifying our scripts I ran into an exception from the vizjoy module. While it is not much of a problem because the exception is thrown when closing the simulation, I'd like to get rid of it because it could obscure a true error. The programming goes like this:

script.py
import A
:
A.go()
module A.py
import B
import vizjoy
:
status = True
:
def go():
:
B.start()
status = ...
:
viz.go()
module B.py
import A

def start():
"""does some inits and install callbacks"""

def react():
if A.status:
:
I found no way around this circular import of modules because I need access to the current value of A.status in Module B. I tried a getter-Method in A but this also throw me this exception:

Exception TypeError: "'NoneType' object is not callable" in <bound method _JoystickCleanup_.__del__ of <vizjoy._JoystickCleanup_ instance at 0x04787418>> ignored

Appreciate any hints, ideas and even solutions...
BR Walter

farshizzo
11-30-2012, 12:13 PM
The next release of Vizard should prevent this exception from occurring. Either way, it would be best if you could prevent the circular import. Can you place the status field in the B module?

fordprefect
12-03-2012, 02:41 AM
Hi farshizzo,

thanks for this idea. From a conceptual viewpoint, the status variable belongs to module A, as the status is updated there. Module B only references the status, and was designed to only be an optional module.

Being practical, I agree that this should solve the problem. Thank you.

BR Walter