本文整理汇总了Python中PyQt4.QtWebKit.QWebSettings.setMaximumPagesInCache方法的典型用法代码示例。如果您正苦于以下问题:Python QWebSettings.setMaximumPagesInCache方法的具体用法?Python QWebSettings.setMaximumPagesInCache怎么用?Python QWebSettings.setMaximumPagesInCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtWebKit.QWebSettings
的用法示例。
在下文中一共展示了QWebSettings.setMaximumPagesInCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtWebKit import QWebSettings [as 别名]
# 或者: from PyQt4.QtWebKit.QWebSettings import setMaximumPagesInCache [as 别名]
def __init__(
self,
log,
confirm_callback=None,
prompt_callback=None,
user_agent=USER_AGENT,
enable_developer_tools=False,
parent=None,
):
QWebPage.__init__(self, parent)
self.log = log
self.user_agent = user_agent if user_agent else USER_AGENT
self.confirm_callback = confirm_callback
self.prompt_callback = prompt_callback
self.setForwardUnsupportedContent(True)
self.unsupportedContent.connect(self.on_unsupported_content)
settings = self.settings()
if enable_developer_tools:
settings.setAttribute(QWebSettings.DeveloperExtrasEnabled, True)
QWebSettings.enablePersistentStorage(os.path.join(cache_dir(), "webkit-persistence"))
QWebSettings.setMaximumPagesInCache(0)
self.bridge_name = "b" + uuid.uuid4().get_hex()
self.mainFrame().javaScriptWindowObjectCleared.connect(self.add_window_objects)
self.dom_loaded = False
示例2: __init__
# 需要导入模块: from PyQt4.QtWebKit import QWebSettings [as 别名]
# 或者: from PyQt4.QtWebKit.QWebSettings import setMaximumPagesInCache [as 别名]
def __init__(self, log,
confirm_callback=None,
prompt_callback=None,
user_agent=USER_AGENT,
enable_developer_tools=False,
parent=None):
QWebPage.__init__(self, parent)
self.log = log
self.user_agent = user_agent if user_agent else USER_AGENT
self.confirm_callback = confirm_callback
self.prompt_callback = prompt_callback
self.setForwardUnsupportedContent(True)
self.unsupportedContent.connect(self.on_unsupported_content)
settings = self.settings()
if enable_developer_tools:
settings.setAttribute(QWebSettings.DeveloperExtrasEnabled, True)
QWebSettings.enablePersistentStorage(os.path.join(cache_dir(),
'webkit-persistence'))
QWebSettings.setMaximumPagesInCache(0)