本文整理匯總了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