def connectAndListen(self, handler): """Set the transport handler, attach to the skype instance, and listen for input""" s = Skype4Py.Skype(Transport='x11') try: s.Attach() except: logger.error("Could not connect to skype!") logger.error("Verify that skype is launched and that the program is allowing us to connect") sys.exit(1) else: s.OnMessageStatus = handler try: while True: time.sleep(1) except KeyboardInterrupt: c = Command(None) c.closeDB() logger.info("Terminating program...") sys.exit(0)
def close(self): c = Command(None) c.closeDB()