本文整理匯總了Python中quodlibet.util.dprint.Colorise.red方法的典型用法代碼示例。如果您正苦於以下問題:Python Colorise.red方法的具體用法?Python Colorise.red怎麽用?Python Colorise.red使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類quodlibet.util.dprint.Colorise
的用法示例。
在下文中一共展示了Colorise.red方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: printErrors
# 需要導入模塊: from quodlibet.util.dprint import Colorise [as 別名]
# 或者: from quodlibet.util.dprint.Colorise import red [as 別名]
def printErrors(self):
succ = self.testsRun - (len(self.errors) + len(self.failures))
v = Colorise.bold("%3d" % succ)
cv = Colorise.green(v) if succ == self.testsRun else Colorise.red(v)
count = self.TEST_RESULTS_WIDTH - self.testsRun
print_((" " * count) + cv)
self.printErrorList('ERROR', self.errors)
self.printErrorList('FAIL', self.failures)
示例2: printErrorList
# 需要導入模塊: from quodlibet.util.dprint import Colorise [as 別名]
# 或者: from quodlibet.util.dprint.Colorise import red [as 別名]
def printErrorList(self, flavour, errors):
for test, err in errors:
print_(self.MAJOR_SEPARATOR)
print_(Colorise.red("%s: %s" % (flavour, str(test))))
print_(self.MINOR_SEPARATOR)
# tracebacks can contain encoded paths, not sure
# what the right fix is here, so use repr
for line in err.splitlines():
print_(repr(line)[1:-1])
示例3: _red
# 需要導入模塊: from quodlibet.util.dprint import Colorise [as 別名]
# 或者: from quodlibet.util.dprint.Colorise import red [as 別名]
def _red(cls, text):
from quodlibet.util.dprint import Colorise
return Colorise.red(text) if cls.use_colors else text
示例4: addFailure
# 需要導入模塊: from quodlibet.util.dprint import Colorise [as 別名]
# 或者: from quodlibet.util.dprint.Colorise import red [as 別名]
def addFailure(self, test, err):
unittest.TestResult.addFailure(self, test, err)
print_(Colorise.red(self.CHAR_FAILURE), end="")
示例5: addError
# 需要導入模塊: from quodlibet.util.dprint import Colorise [as 別名]
# 或者: from quodlibet.util.dprint.Colorise import red [as 別名]
def addError(self, test, err):
unittest.TestResult.addError(self, test, err)
print_(Colorise.red(self.CHAR_ERROR), end="")