Update
This commit is contained in:
23
2023/scripts/rigging_tools/ngskintools2/cleanup.py
Normal file
23
2023/scripts/rigging_tools/ngskintools2/cleanup.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
The purpose of the module is mostly for testing: close everything and prepare for source reload
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
from ngSkinTools2.api.log import getLogger
|
||||
|
||||
handlers = []
|
||||
|
||||
log = getLogger("cleanup")
|
||||
|
||||
|
||||
def registerCleanupHandler(handler):
|
||||
handlers.append(handler)
|
||||
|
||||
|
||||
def cleanup():
|
||||
while len(handlers) > 0:
|
||||
handler = handlers.pop()
|
||||
try:
|
||||
handler()
|
||||
except Exception as err:
|
||||
log.error(err)
|
||||
Reference in New Issue
Block a user