Exemplo n.º 1
0
def init(history):
    """Initialize the QWebHistoryInterface.

    Args:
        history: The WebHistory object.
    """
    interface = WebHistoryInterface(history, parent=history)
    QWebHistoryInterface.setDefaultInterface(interface)
Exemplo n.º 2
0
def init(history):
    """Initialize the QWebHistoryInterface.

    Args:
        history: The WebHistory object.
    """
    interface = WebHistoryInterface(history, parent=history)
    QWebHistoryInterface.setDefaultInterface(interface)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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)
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
 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
Exemplo n.º 9
0
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
Exemplo n.º 10
0
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)
Exemplo n.º 11
0
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)
Exemplo n.º 12
0
def init():
    """Initialize the web history."""
    history = WebHistory()
    objreg.register('web-history', history)
    QWebHistoryInterface.setDefaultInterface(history)