def Cleanup(): import __main__ from spell.lib.drivermgr import DriverManager from spell.lib.registry import REGISTRY from server.ui.cmdline import ClientIF DriverManager.instance().cleanup(shutdown=True) for ifc in REGISTRY.interfaces(): REGISTRY.remove(ifc) if __main__.__dict__.has_key(ifc): __main__.__dict__.pop(ifc) if 'CIF' in REGISTRY.interfaces(): ClientIF.cleanup()
def Cleanup(): import __main__ from spell.lib.drivermgr import DriverManager from spell.lib.registry import REGISTRY from server.ui.cmdline import ClientIF DriverManager.instance().cleanup(shutdown=True) for ifc in REGISTRY.interfaces(): REGISTRY.remove(ifc) if __main__.__dict__.has_key(ifc): __main__.__dict__.pop(ifc) if "CIF" in REGISTRY.interfaces(): ClientIF.cleanup()
def Setup(ctxName, showProgress=True): import __main__ from spell.lib.drivermgr import DriverManager from spell.lib.registry import REGISTRY from server.ui.cmdline import ClientIF from spell.config.reader import Config try: DriverManager.instance().setup(ctxName) except SpellException, ex: print "Unable to setup driver: ", ex.message, ex.reason DriverManager.instance().cleanup(force=True) return False