本文整理汇总了Python中gi.repository.WebKit.get_favicon_database方法的典型用法代码示例。如果您正苦于以下问题:Python WebKit.get_favicon_database方法的具体用法?Python WebKit.get_favicon_database怎么用?Python WebKit.get_favicon_database使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.WebKit
的用法示例。
在下文中一共展示了WebKit.get_favicon_database方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gi.repository import WebKit [as 别名]
# 或者: from gi.repository.WebKit import get_favicon_database [as 别名]
def __init__(self, com_dict: object):
""" Initialize the process.
"""
from gi.repository import Soup as libsoup
from gi.repository import WebKit as libwebkit
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import GLib as glib
self._icon_db = libwebkit.get_favicon_database()
cookiejar = libsoup.CookieJar()
cookiejar.set_accept_policy(libsoup.CookieJarAcceptPolicy.NO_THIRD_PARTY)
session = libwebkit.get_default_session()
print("SESSION: ", session)
session.add_feature(cookiejar)
session.set_property('ssl-use-system-ca-file', True)
session.set_property('ssl-strict', True)
print("SESSION PROP", session.get_property('tls-database'))
# session.connect('connection-created', self._soup_connection)
# proxy_uri = libsoup.URI.new(os.getenv('http_proxy'))
# session.set_property('proxy-uri', proxy_uri)
self._libsoup = libsoup
self._gtk = gtk
self._gdk = gdk
self._glib = glib
self._libwebkit = libwebkit
self._dict = com_dict
self._coms = []
self._pid = multiprocessing.current_process().pid
self._windows = []
for socket_id, com_pipe in self._dict.items():
print("CREATING: ", socket_id, com_pipe)
try:
com_pipe.send(('pid', self._pid))
except BrokenPipeError as err:
print("BROKEN PIPE: ", err, ' on PIPE ', com_pipe)
continue
self._windows.append(self._create_window(socket_id, com_pipe))