def __init__(self): signal.signal(signal.SIGINT, self.stop) if WIN32_FROZEN: static_path = os.path.join( os.path.dirname(os.path.abspath(sys.executable)), 'static') Win32StopThread(self.stop).start() else: static_path = None #default static path will be used signal.signal(signal.SIGINT, self.stop) self.server = MgmtServer('0.0.0.0', DAEMON_PORT, IdepositboxClient(), static_path)
def init_console(self): self.mocked_id_client = get_test_idepositbox_client() self.mgmt_console = MgmtServer('127.0.0.1', 9999, self.mocked_id_client) self.mgmt_console.start() for i in xrange(20): if self.mgmt_console.is_ready(): break time.sleep(.5) else: raise Exception('Management console does not started!') self.mocked_id_client.simulate_id_client(OK, area={'get_available_media_storages': []})