@@ -0,0 +1,837 @@
+__names__ = %5B'get_a_manager'%5D%0A%0Aimport logging%0A%0Aimport threading%0A%0Afrom mirte.core import Manager%0A%0A__singleton_manager = None%0A%0Adef get_a_manager():%0A        %22%22%22 On first call, creates and returns a @mirte.core.Manager.  On%0A            subsequent calls, returns the previously created instance %22%22%22%0A        global __singleton_manager%0A        if __singleton_manager is None:%0A                def _thread_entry():%0A                        m.run()%0A                        l.info('manager.run() returned')%0A                l = logging.getLogger('mirte.get_a_manager')%0A                l.info(%22Creating new instance%22)%0A                m = Manager(logging.getLogger('mirte'))%0A                threading.Thread(target=_thread_entry).start()%0A                m.running_event.wait()%0A                __singleton_manager = m%0A        return __singleton_manager%0A

add get_a_manager()