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


Python Colorise.blue方法代码示例

本文整理汇总了Python中quodlibet.util.dprint.Colorise.blue方法的典型用法代码示例。如果您正苦于以下问题:Python Colorise.blue方法的具体用法?Python Colorise.blue怎么用?Python Colorise.blue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在quodlibet.util.dprint.Colorise的用法示例。


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

示例1: bin_debug

# 需要导入模块: from quodlibet.util.dprint import Colorise [as 别名]
# 或者: from quodlibet.util.dprint.Colorise import blue [as 别名]
def bin_debug(elements, depth=0, lines=None):
    """Takes a list of gst.Element that are part of a prerolled pipeline, and
    recursively gets the children and all caps between the elements.

    Returns a list of text lines suitable for printing.
    """

    from quodlibet.util.dprint import Colorise

    if lines is None:
        lines = []
    else:
        lines.append(" " * (depth - 1) + "\\")

    for i, elm in enumerate(elements):
        for pad in iter_to_list(elm.iterate_sink_pads):
            caps = pad.get_current_caps()
            if caps:
                lines.append("%s| %s" % (" " * depth, caps.to_string()))
        name = elm.get_name()
        cls = Colorise.blue(type(elm).__name__.split(".", 1)[-1])
        lines.append("%s|-%s (%s)" % (" " * depth, cls, name))

        if isinstance(elm, Gst.Bin):
            children = reversed(iter_to_list(elm.iterate_sorted))
            bin_debug(children, depth + 1, lines)

    return lines
开发者ID:Konzertheld,项目名称:quodlibet,代码行数:30,代码来源:util.py


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