本文整理汇总了Python中coalib.output.printers.LogPrinter.LogPrinter.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python LogPrinter.__init__方法的具体用法?Python LogPrinter.__init__怎么用?Python LogPrinter.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coalib.output.printers.LogPrinter.LogPrinter
的用法示例。
在下文中一共展示了LogPrinter.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from coalib.output.printers.LogPrinter import LogPrinter [as 别名]
# 或者: from coalib.output.printers.LogPrinter.LogPrinter import __init__ [as 别名]
def __init__(self,
log_level=LOG_LEVEL.WARNING,
timestamp_format="%X"):
Printer.__init__(self)
LogPrinter.__init__(self, self, log_level, timestamp_format)
self.logs = []
示例2: __init__
# 需要导入模块: from coalib.output.printers.LogPrinter import LogPrinter [as 别名]
# 或者: from coalib.output.printers.LogPrinter.LogPrinter import __init__ [as 别名]
def __init__(self,
section: Section,
message_queue,
timeout=0):
"""
Constructs a new bear.
:param section: The section object where bear settings are
contained.
:param message_queue: The queue object for messages. Can be ``None``.
:param timeout: The time the bear is allowed to run. To set no
time limit, use 0.
:raises TypeError: Raised when ``message_queue`` is no queue.
:raises RuntimeError: Raised when bear requirements are not fulfilled.
"""
Printer.__init__(self)
LogPrinter.__init__(self, self)
if message_queue is not None and not hasattr(message_queue, "put"):
raise TypeError("message_queue has to be a Queue or None.")
self.section = section
self.message_queue = message_queue
self.timeout = timeout
self.setup_dependencies()
cp = type(self).check_prerequisites()
if cp is not True:
error_string = ("The bear " + self.name +
" does not fulfill all requirements.")
if cp is not False:
error_string += " " + cp
self.warn(error_string)
raise RuntimeError(error_string)
示例3: __init__
# 需要导入模块: from coalib.output.printers.LogPrinter import LogPrinter [as 别名]
# 或者: from coalib.output.printers.LogPrinter.LogPrinter import __init__ [as 别名]
def __init__(self,
section: Section,
message_queue,
timeout=0):
Printer.__init__(self)
LogPrinter.__init__(self, self)
if not hasattr(message_queue, "put") and message_queue is not None:
raise TypeError("message_queue has to be a Queue or None.")
self.section = section
self.message_queue = message_queue
self.timeout = timeout
示例4: __init__
# 需要导入模块: from coalib.output.printers.LogPrinter import LogPrinter [as 别名]
# 或者: from coalib.output.printers.LogPrinter.LogPrinter import __init__ [as 别名]
def __init__(self, log_queue):
LogPrinter.__init__(self, self)
self.log_queue = log_queue
self.set_up = False
示例5: __init__
# 需要导入模块: from coalib.output.printers.LogPrinter import LogPrinter [as 别名]
# 或者: from coalib.output.printers.LogPrinter.LogPrinter import __init__ [as 别名]
def __init__(self):
ColorPrinter.__init__(self)
LogPrinter.__init__(self)
示例6: __init__
# 需要导入模块: from coalib.output.printers.LogPrinter import LogPrinter [as 别名]
# 或者: from coalib.output.printers.LogPrinter.LogPrinter import __init__ [as 别名]
def __init__(self):
LogPrinter.__init__(self, self)
示例7: __init__
# 需要导入模块: from coalib.output.printers.LogPrinter import LogPrinter [as 别名]
# 或者: from coalib.output.printers.LogPrinter.LogPrinter import __init__ [as 别名]
def __init__(self, result_queue, log_queue):
Interactor.__init__(self)
LogPrinter.__init__(self)
self.result_queue = result_queue
self.log_queue = log_queue
self.set_up = False
示例8: __init__
# 需要导入模块: from coalib.output.printers.LogPrinter import LogPrinter [as 别名]
# 或者: from coalib.output.printers.LogPrinter.LogPrinter import __init__ [as 别名]
def __init__(self, log_level=LOG_LEVEL.WARNING, timestamp_format="%X"):
ColorPrinter.__init__(self)
LogPrinter.__init__(self, log_level=log_level, timestamp_format=timestamp_format)