本文整理汇总了Python中ProgressBar.ProgressBar.update_time方法的典型用法代码示例。如果您正苦于以下问题:Python ProgressBar.update_time方法的具体用法?Python ProgressBar.update_time怎么用?Python ProgressBar.update_time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressBar.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.update_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ProgressBar import ProgressBar [as 别名]
# 或者: from ProgressBar.ProgressBar import update_time [as 别名]
class UserMsg:
"""User Message Class"""
def __init__(self):
pass
def pbarinit(self, maxnum):
"""initialize progress bar"""
self.p = ProgressBar(maxnum)
self.p.fill_char = '='
self.count = 0
def seekmode(self):
"""Seek Mode Message"""
print bcolors.cyan + ">>> Seeking Mode " + bcolors.white+"[" + \
bcolors.highlightmagenta + "enabled" + \
bcolors.reset+bcolors.white + "]"
def destroymode(self):
"""Destroy Mode Message"""
print bcolors.cyan + ">>> Destroying Mode " + bcolors.white + "[" + \
bcolors.highlightmagenta + "enabled" + \
bcolors.reset+bcolors.white + "]"
def seeking(self, source):
"""Seeking Message"""
sys.stdout.write("\r")
sys.stdout.write(bcolors.green+" Seeking in ")
sys.stdout.write(bcolors.red+"%s" % source)
sys.stdout.write(bcolors.green+" ................. ")
sys.stdout.flush()
def seekupdate(self, source):
"""Seeking Update Message (Progress Bar)"""
self.count += 1
str1 = bcolors.green+" Seeking in"+bcolors.red+" %s " % source
str2 = str1+bcolors.green+"................. "+bcolors.yellow
self.p.update_time(self.count)
sys.stdout.write("\r")
sys.stdout.write("%s%s" % (str2, self.p))
sys.stdout.flush()
def destroying(self, source):
"""Destroying Message"""
sys.stdout.write("\r")
sys.stdout.write(bcolors.green+" Destroying in ")
sys.stdout.write(bcolors.red+"%s" % source)
sys.stdout.write(bcolors.green+" ............. ")
sys.stdout.flush()
def destroyupdate(self, source):
"""Destroying Update Message (Progress Bar)"""
self.count += 1
str1 = bcolors.green+" Destroying in "+bcolors.red+" %s " % source
str2 = str1+bcolors.green+"............. "+bcolors.yellow
self.p.update_time(self.count)
sys.stdout.write("\r")
sys.stdout.write("%s%s" % (str2, self.p))
sys.stdout.flush()
def md5(self):
"""MD5 Process Message"""
sys.stdout.write(bcolors.blue+" MD5")
sys.stdout.flush()
def flist(self, source):
"""Getting File List Message"""
sys.stdout.write("\r")
sys.stdout.write(bcolors.green+" Getting file list in ")
sys.stdout.write(bcolors.red+"%s" % source)
sys.stdout.write(bcolors.green+" ... ")
sys.stdout.flush()
def wiping(self):
""" Wiping database Message"""
sys.stdout.write("\r")
sys.stdout.write(bcolors.green+" Wiping database")
sys.stdout.write(bcolors.green+" ............. ")
sys.stdout.flush()
def cleaning(self):
"""Cleaning database Messagem"""
sys.stdout.write("\r")
sys.stdout.write(bcolors.green+" Cleaning database")
sys.stdout.write(bcolors.green+" ............. ")
sys.stdout.flush()
def done(self):
"""Just a done message"""
sys.stdout.write(bcolors.white + "[" + bcolors.blue + \
"done" + bcolors.white + "]")
sys.stdout.flush()
print bcolors.reset
def reset(self):
"""Reset color"""
print bcolors.reset