当前位置: 首页>>代码示例>>Python>>正文


Python debug.qflags_key函数代码示例

本文整理汇总了Python中qutebrowser.utils.debug.qflags_key函数的典型用法代码示例。如果您正苦于以下问题:Python qflags_key函数的具体用法?Python qflags_key怎么用?Python qflags_key使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了qflags_key函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _call_cb

    def _call_cb(self, callback, found, text, flags, caller):
        """Call the given callback if it's non-None.

        Delays the call via a QTimer so the website is re-rendered in between.

        Args:
            callback: What to call
            found: If the text was found
            text: The text searched for
            flags: The flags searched with
            caller: Name of the caller.
        """
        found_text = 'found' if found else "didn't find"
        # Removing FindWrapsAroundDocument to get the same logging as with
        # QtWebEngine
        debug_flags = debug.qflags_key(
            QWebPage, flags & ~QWebPage.FindWrapsAroundDocument,
            klass=QWebPage.FindFlag)
        if debug_flags != '0x0000':
            flag_text = 'with flags {}'.format(debug_flags)
        else:
            flag_text = ''
        log.webview.debug(' '.join([caller, found_text, text, flag_text])
                          .strip())
        if callback is not None:
            QTimer.singleShot(0, functools.partial(callback, found))
开发者ID:swalladge,项目名称:qutebrowser,代码行数:26,代码来源:webkittab.py

示例2: _on_fullscreen_requested

 def _on_fullscreen_requested(self, on):
     if not config.val.content.windowed_fullscreen:
         if on:
             self.state_before_fullscreen = self.windowState()
             self.setWindowState(
                 Qt.WindowFullScreen | self.state_before_fullscreen)
         elif self.isFullScreen():
             self.setWindowState(self.state_before_fullscreen)
     log.misc.debug('on: {}, state before fullscreen: {}'.format(
         on, debug.qflags_key(Qt, self.state_before_fullscreen)))
开发者ID:fiete201,项目名称:qutebrowser,代码行数:10,代码来源:mainwindow.py

示例3: wrapped_callback

 def wrapped_callback(found):
     """Wrap the callback to do debug logging."""
     found_text = 'found' if found else "didn't find"
     if flags:
         flag_text = 'with flags {}'.format(debug.qflags_key(
             QWebEnginePage, flags, klass=QWebEnginePage.FindFlag))
     else:
         flag_text = ''
     log.webview.debug(' '.join([caller, found_text, text, flag_text])
                       .strip())
     if callback is not None:
         callback(found)
开发者ID:phansch,项目名称:qutebrowser,代码行数:12,代码来源:webenginetab.py

示例4: wrapped_callback

        def wrapped_callback(found):
            """Wrap the callback to do debug logging."""
            self._pending_searches -= 1
            if self._pending_searches > 0:
                # See https://github.com/qutebrowser/qutebrowser/issues/2442
                # and https://github.com/qt/qtwebengine/blob/5.10/src/core/web_contents_adapter.cpp#L924-L934
                log.webview.debug("Ignoring cancelled search callback with "
                                  "{} pending searches".format(
                                      self._pending_searches))
                return

            found_text = 'found' if found else "didn't find"
            if flags:
                flag_text = 'with flags {}'.format(debug.qflags_key(
                    QWebEnginePage, flags, klass=QWebEnginePage.FindFlag))
            else:
                flag_text = ''
            log.webview.debug(' '.join([caller, found_text, text, flag_text])
                              .strip())
            if callback is not None:
                callback(found)
开发者ID:Harrison97,项目名称:qutebrowser,代码行数:21,代码来源:webenginetab.py

示例5: test_multiple

def test_multiple():
    """Test with multiple values."""
    flags = debug.qflags_key(Qt, Qt.AlignLeft | Qt.AlignTop)
    assert flags == 'AlignLeft|AlignTop'
开发者ID:JIVS,项目名称:qutebrowser,代码行数:4,代码来源:test_qflags_key.py

示例6: test_add_base

 def test_add_base(self):
     """Test with add_base=True."""
     flags = debug.qflags_key(Qt, Qt.AlignTop, add_base=True)
     self.assertEqual(flags, 'Qt.AlignTop')
开发者ID:HalosGhost,项目名称:qutebrowser,代码行数:4,代码来源:test_debug.py

示例7: test_int_noklass

 def test_int_noklass(self):
     """Test passing an int without explicit klass given."""
     with pytest.raises(TypeError):
         debug.qflags_key(Qt, 42)
开发者ID:vyp,项目名称:qutebrowser,代码行数:4,代码来源:test_debug.py

示例8: test_add_base

 def test_add_base(self):
     """Test with add_base=True."""
     flags = debug.qflags_key(Qt, Qt.AlignTop, add_base=True)
     assert flags == 'Qt.AlignTop'
开发者ID:vyp,项目名称:qutebrowser,代码行数:4,代码来源:test_debug.py

示例9: test_qflags_key

 def test_qflags_key(self, base, value, klass, expected):
     flags = debug.qflags_key(base, value, klass=klass)
     assert flags == expected
开发者ID:vyp,项目名称:qutebrowser,代码行数:3,代码来源:test_debug.py

示例10: test_unknown

def test_unknown():
    """Test passing an unknown value."""
    flags = debug.qflags_key(Qt, 0x1100, klass=Qt.Alignment)
    assert flags == '0x0100|0x1000'
开发者ID:JIVS,项目名称:qutebrowser,代码行数:4,代码来源:test_qflags_key.py

示例11: test_int

def test_int():
    """Test passing an int with explicit klass given."""
    flags = debug.qflags_key(Qt, 0x0021, klass=Qt.Alignment)
    assert flags == 'AlignLeft|AlignTop'
开发者ID:JIVS,项目名称:qutebrowser,代码行数:4,代码来源:test_qflags_key.py

示例12: test_combined

def test_combined():
    """Test with a combined value."""
    flags = debug.qflags_key(Qt, Qt.AlignCenter)
    assert flags == 'AlignHCenter|AlignVCenter'
开发者ID:JIVS,项目名称:qutebrowser,代码行数:4,代码来源:test_qflags_key.py

示例13: test_single

def test_single():
    """Test with single value."""
    flags = debug.qflags_key(Qt, Qt.AlignTop)
    assert flags == 'AlignTop'
开发者ID:JIVS,项目名称:qutebrowser,代码行数:4,代码来源:test_qflags_key.py

示例14: test_combined

 def test_combined(self):
     """Test with a combined value."""
     flags = debug.qflags_key(Qt, Qt.AlignCenter)
     self.assertEqual(flags, 'AlignHCenter|AlignVCenter')
开发者ID:HalosGhost,项目名称:qutebrowser,代码行数:4,代码来源:test_debug.py

示例15: test_multiple

 def test_multiple(self):
     """Test with multiple values."""
     flags = debug.qflags_key(Qt, Qt.AlignLeft | Qt.AlignTop)
     self.assertEqual(flags, 'AlignLeft|AlignTop')
开发者ID:HalosGhost,项目名称:qutebrowser,代码行数:4,代码来源:test_debug.py


注:本文中的qutebrowser.utils.debug.qflags_key函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。