def init(history): """Initialize the QWebHistoryInterface. Args: history: The WebHistory object. """ interface = WebHistoryInterface(history, parent=history) QWebHistoryInterface.setDefaultInterface(interface)
def init(history): """Initialize the QWebHistoryInterface. Args: history: The WebHistory object. """ interface = WebHistoryInterface(history, parent=history) QWebHistoryInterface.setDefaultInterface(interface)
def init(parent=None): """Initialize the web history. Args: parent: The parent to use for WebHistory. """ history = WebHistory(parent) objreg.register("web-history", history) QWebHistoryInterface.setDefaultInterface(history)
def init(parent=None): """Initialize the web history. Args: parent: The parent to use for WebHistory. """ history = WebHistory(parent) objreg.register('web-history', history) QWebHistoryInterface.setDefaultInterface(history)
def hist_interface(): entry = history.Entry(atime=0, url=QUrl('http://www.example.com/'), title='example') history_dict = {'http://www.example.com/': entry} fake_hist = FakeWebHistory(history_dict) interface = history.WebHistoryInterface(fake_hist) QWebHistoryInterface.setDefaultInterface(interface) yield QWebHistoryInterface.setDefaultInterface(None)
def hist_interface(): entry = history.Entry(atime=0, url=QUrl('http://www.example.com/'), title='example') history_dict = {'http://www.example.com/': entry} fake_hist = FakeWebHistory(history_dict) interface = history.WebHistoryInterface(fake_hist) QWebHistoryInterface.setDefaultInterface(interface) yield QWebHistoryInterface.setDefaultInterface(None)
def cleanup_init(self): # prevent test_init from leaking state yield if history.web_history is not None: history.web_history.setParent(None) history.web_history = None try: from PyQt5.QtWebKit import QWebHistoryInterface QWebHistoryInterface.setDefaultInterface(None) except ImportError: pass
def cleanup_init(self): # prevent test_init from leaking state yield web_history = objreg.get('web-history', None) if web_history is not None: web_history.setParent(None) objreg.delete('web-history') try: from PyQt5.QtWebKit import QWebHistoryInterface QWebHistoryInterface.setDefaultInterface(None) except ImportError: pass
def cleanup_init(): # prevent test_init from leaking state yield hist = objreg.get('web-history', None) if hist is not None: hist.setParent(None) objreg.delete('web-history') try: from PyQt5.QtWebKit import QWebHistoryInterface QWebHistoryInterface.setDefaultInterface(None) except ImportError: pass
def init(parent=None): """Initialize the web history. Args: parent: The parent to use for WebHistory. """ history = WebHistory(hist_dir=standarddir.data(), hist_name='history', parent=parent) objreg.register('web-history', history) interface = WebHistoryInterface(history, parent=history) QWebHistoryInterface.setDefaultInterface(interface)
def init(parent=None): """Initialize the web history. Args: parent: The parent to use for WebHistory. """ history = WebHistory(hist_dir=standarddir.data(), hist_name='history', parent=parent) objreg.register('web-history', history) interface = WebHistoryInterface(history, parent=history) QWebHistoryInterface.setDefaultInterface(interface)
def init(): """Initialize the web history.""" history = WebHistory() objreg.register('web-history', history) QWebHistoryInterface.setDefaultInterface(history)