How to use the cefpython3.cefpython.Shutdown function in cefpython3

To help you get started, we’ve selected a few cefpython3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github james-owen-ryan / talktown-testbed / browser.py View on Github external
errorMsg = errorMsg.decode(encoding=appEncoding, errors="replace")
        try:
            with codecs.open(errorFile, mode="a", encoding=appEncoding) as fp:
                fp.write("\n[%s] %s\n" % (
                        time.strftime("%Y-%m-%d %H:%M:%S"), errorMsg))
        except:
            print("[cefhello] WARNING: failed writing to error file: %s" % (
                    errorFile))
        # Convert error message to ascii before printing, otherwise
        # you may get error like this:
        # | UnicodeEncodeError: 'charmap' codec can't encode characters
        errorMsg = errorMsg.encode("ascii", errors="replace")
        errorMsg = errorMsg.decode("ascii", errors="replace")
        print("\n"+errorMsg+"\n")
        cefpython.QuitMessageLoop()
        cefpython.Shutdown()
        os._exit(1)
github cztomczak / cefpython / src / linux / binaries_32bit / wxpython.py View on Github external
errorMsg = errorMsg.decode(encoding=appEncoding, errors="replace")
    try:
        with codecs.open(errorFile, mode="a", encoding=appEncoding) as fp:
            fp.write("\n[%s] %s\n" % (
                    time.strftime("%Y-%m-%d %H:%M:%S"), errorMsg))
    except:
        print("[wxpython.py] WARNING: failed writing to error file: %s" % (
                errorFile))
    # Convert error message to ascii before printing, otherwise
    # you may get error like this:
    # | UnicodeEncodeError: 'charmap' codec can't encode characters
    errorMsg = errorMsg.encode("ascii", errors="replace")
    errorMsg = errorMsg.decode("ascii", errors="replace")
    print("\n"+errorMsg+"\n")
    cefpython.QuitMessageLoop()
    cefpython.Shutdown()
    os._exit(1)
github OmniDB / OmniDB / OmniDB / omnidb-app.py View on Github external
def init_browser(server_port):
    sys.excepthook = cef.ExceptHook  # To shutdown all CEF processes on error
    cef.Initialize()
    cef.CreateBrowserSync(url="http://localhost:{0}?user=admin&pwd=admin".format(str(server_port)),window_title="OmniDB")
    cef.MessageLoop()
    cef.Shutdown()
    cherrypy.engine.exit()
github cztomczak / cefpython / cefpython / windows / binaries_32bit / pyqt.py View on Github external
errorMsg = errorMsg.decode(encoding=appEncoding, errors="replace")
    try:
        with codecs.open(errorFile, mode="a", encoding=appEncoding) as fp:
            fp.write("\n[%s] %s\n" % (
                    time.strftime("%Y-%m-%d %H:%M:%S"), errorMsg))
    except:
        print("[pyqt.py] WARNING: failed writing to error file: %s" % (
                errorFile))
    # Convert error message to ascii before printing, otherwise
    # you may get error like this:
    # | UnicodeEncodeError: 'charmap' codec can't encode characters
    errorMsg = errorMsg.encode("ascii", errors="replace")
    errorMsg = errorMsg.decode("ascii", errors="replace")
    print("\n"+errorMsg+"\n")
    cefpython.QuitMessageLoop()
    cefpython.Shutdown()
    os._exit(1)
github cztomczak / cefpython / cefpython / wx / chromectrl.py View on Github external
def Shutdown():
    """Shuts down CEF, should be called by app exiting code"""
    DestroyMessageLoopTimer()
    cefpython.Shutdown()
github openassistant / oa-core / part / display.py View on Github external
cef.g_commandLineSwitches = {'enable-media-stream': '','allow-universal-access-from-files':''}
    cef.Initialize(settings={})
    browser = cef.CreateBrowserSync(url='file:///'+os.path.join(oa.cur_dir,'part/display/index.html'),
                                    window_title="Tutorial")
    set_javascript_bindings(browser)
    while oa.alive:
        pars=get(timeout=.01)
        cef.SingleMessageLoop()
        yield ''
        if pars is None:
            continue
        if isinstance(pars,str):
            browser.ExecuteFunction('oa_msg',str(pars))
        if isinstance(pars,(tuple,list)):
            browser.ExecuteFunction(*pars)
    cef.Shutdown()
github RimoChan / Librian / librian / librian_util / wxcef.py View on Github external
if MAC:
        # Issue #442 requires enabling message pump on Mac
        # and calling message loop work in a timer both at
        # the same time. This is an incorrect approach
        # and only a temporary fix.
        settings["external_message_pump"] = True
    if WINDOWS:
        # noinspection PyUnresolvedReferences, PyArgumentList
        cef.DpiAware.EnableHighDpiSupport()
    cef.Initialize(settings=settings)
    app = CefApp(False)
    app.MainLoop()
    del app  # Must destroy before calling Shutdown
    if not MAC:
        # On Mac shutdown is called in OnClose
        cef.Shutdown()
github pygae / pyganja / pyganja / cefwindow.py View on Github external
def run_cef_gui(url_target, title):
    check_versions()
    sys.excepthook = cef.ExceptHook  # To shutdown all CEF processes on error
    cef.Initialize()
    cef.CreateBrowserSync(url=url_target,
                          window_title=title)
    cef.MessageLoop()
    cef.Shutdown()
github dzikoysk / cefstream / src / cef / cef_manager.py View on Github external
def shutdown_cef(self):
        self.cefstream.get_logger().info("Shutting down CEF")
        self.shutdown()
        cef.Shutdown()