Does the atexit package work from within Maya Python?
I’ve tried the straightforward approach:
import sendit
import atexit
atexit.register(sendit.sendit)
where the sendit.sendit() function just sends me an e-mail. I don’t get an e-mail from either Maya2011 or 2012.
There’s a finalize() function registered with atexit in Autodesk\Maya20nn\Python\lib\site-packages\maya\app\startup\basic.py, so you’d think it would work. However the finalize() method doesn’t actually do anything, so no one probably noticed whether it works or not. I’ve also tried putting my sendit() call in the Maya finalize() method and got nothing (which is what leads me to think it doesn’t work).
Is this just broken or is there some trick to getting it to work?
Thanks!
— David