本文整理汇总了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