本文整理汇总了Python中Utils.Utils.colorTags方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.colorTags方法的具体用法?Python Utils.colorTags怎么用?Python Utils.colorTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.Utils
的用法示例。
在下文中一共展示了Utils.colorTags方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: to_row
# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import colorTags [as 别名]
def to_row(self,detailed = False):
last_session = self.last_session()
if last_session:
cur_sess_time = last_session.current_time() if self.status == 1 else 0
total_time = Utils.roundup(self.elapsed + cur_sess_time,2) if self.status == 1 else self.elapsed
cur_sess_time = Utils.hourstohuman(cur_sess_time)
total_time = Utils.hourstohuman(total_time)
if detailed:
return [self.id[0:8],self.name,Utils.colorTags(self.tag),Utils.hourstohuman(self.estimated),len(self.worklog), Utils.datefmt(last_session.start_time), cur_sess_time, total_time, Utils.readableStatus[self.status]]
else:
return [self.id[0:8],self.name,Utils.colorTags(self.tag), Utils.datefmt(last_session.start_time), cur_sess_time, total_time, Utils.readableStatus[self.status]]
else:
if detailed:
return [self.id[0:8],self.name,Utils.colorTags(self.tag),Utils.hourstohuman(self.estimated),len(self.worklog),"-", 0, 0, Utils.readableStatus[self.status]]
else:
return [self.id[0:8],self.name,Utils.colorTags(self.tag),"-", Utils.hourstohuman(0), Utils.hourstohuman(0), Utils.readableStatus[self.status]]
示例2: printTasks
# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import colorTags [as 别名]
def printTasks(self,all=False,detailed=False):
if len(Taskr.tasks) > 0:
print "Your current task log:"
output = Utils.tableHeader(detailed)
output.align["Task"]
Utils.tags["-"] = Utils.colorTags("-")
for task in Taskr.tasks[-5:] if not all else Taskr.tasks:
output.add_row(task.to_row(detailed))
print output.get_string(border=False)
else:
print "You currently don't have any registered tasks"
示例3: printWeeklog
# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import colorTags [as 别名]
def printWeeklog(self):
if len(Taskr.tasks) > 0:
print "This weeks weeklog"
output = Utils.weeklogHeader()
output.align["Date"]
Utils.tags["-"] = Utils.colorTags("-")
self.orderData()
for (time,(task,session)) in self.weeklog:
r = [Utils.dateonlyfmt(time),Utils.houronlyfmt(time),Utils.hourstohuman(session.duration),session.location,task.name,Utils.colorTags(task.tag)]
output.add_row(r)
print output.get_string(border=False)
else:
print "You currently don't have any registered tasks"
示例4: printTask
# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import colorTags [as 别名]
def printTask(self,task=None):
if task is None:
return False
output = Utils.tableHeader(True)
output.align["Task"]
Utils.tags["-"] = Utils.colorTags("-")
output.add_row(task.to_row(True))
print output.get_string(border=False)
print ""
print "Task worklog:"
wsess = Utils.workSessionsTableHeader()
wsess.align["Start"]
wsess.align["Related Commits"] = "l"
for ws in task.worklog:
wsess.add_row(ws.to_row())
print wsess.get_string(border=False)