def app_main(withgui): try: infomsg('loading TWISTED subsystem') from twisted.internet import reactor from twisted.logger import STDLibLogObserver, globalLogBeginner # redirect twisted logging to python logging globalLogBeginner.beginLoggingTo([STDLibLogObserver()]) infomsg('starting application.') # DHCP, DNS: find missing addresses setExternalPhoneAddress() setExternalGateway() setExternalProxyAddress() try: #force exception if not found config.get(consts.SECTION, consts.EXTPHONEADDR) config.get(consts.SECTION, consts.LOCPROXYADDR) config.get(consts.SECTION, consts.EXTGATEWAY) config.get(consts.SECTION, consts.EXTPROXYADDR) except: raise ZsiposCfgException("wrong or missing parameter") import rtp rtp.init() # @UndefinedVariable if withgui: def thread_init_cb(): rtp.register_gui_thread() # @UndefinedVariable import gui gui.init(thread_init_cb) # @UndefinedVariable log.info("loading SIP subsystem") import GMITM gmitm = GMITM.GMITM() if withgui: gmitm.setEventSink( gui.GUI_GMITMEventListener()) # @UndefinedVariable log.info("GMITM created.") reactor.callLater(1, rtp.postinit) # @UndefinedVariable reactor.run(installSignalHandlers=True) # @UndefinedVariable finally: try: gui.close() # @UndefinedVariable except: pass try: rtp.close() # @UndefinedVariable except: pass
def changeListings(): gui.close() ADDON.openSettings(ADDON) xbmc.executebuiltin('XBMC.ActivateWindow(home)') w = gui.TVGuide() w.doModal() del w changeListings()
def changeListings(): gui.close() ADDON.openSettings(ADDON) xbmc.executebuiltin("XBMC.ActivateWindow(home)") w = gui.TVGuide() w.doModal() del w changeListings()
import cv2 import gui import argparse parser = argparse.ArgumentParser(description='Threshold some images') parser.add_argument('image', type=str, help='Path to an image') args = parser.parse_args() image = cv2.imread(args.image) while True: gui.display(image) try: gui.refresh() except KeyboardInterrupt: break gui.close()