def __init__(self, console_or_stream=None, **kwargs):
if isinstance(console_or_stream, Console):
self.console = console_or_stream
else:
self.console = Console(console_or_stream)
self.template = kwargs.get('template', self.TEMPLATE)
self.progress_template = \
kwargs.get('progress_template', self.PROGRESS_TEMPLATE)
self.progress_brick = kwargs.get('progress_brick', self.PROGRESS_BRICK)
self.progress_num_bricks = \
kwargs.get('progress_num_bricks', self.PROGRESS_NUM_BRICKS)
self.percent_template = \
kwargs.get('percent_template', self.PERCENT_TEMPLATE)
self.current_template = \
kwargs.get('current_template', self.CURRENT_TEMPLATE)
self.total_template = \
kwargs.get('total_template', self.TOTAL_TEMPLATE)
self.eta_template = kwargs.get('eta_template', self.ETA_TEMPLATE)
self.screw_template = kwargs.get('screw_template', self.SCREW_TEMPLATE)
self.refresh_every = kwargs.get('refresh_every', self.REFRESH_EVERY)
self.line_template = self.build_line_template()
self.start_datetime = None
self.screw_cycle = itertools.cycle(('|', '/', '-', '\\'))
评论列表
文章目录