当前位置: 首页>>代码示例>>Python>>正文


Python Utils.hourstohuman方法代码示例

本文整理汇总了Python中Utils.Utils.hourstohuman方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.hourstohuman方法的具体用法?Python Utils.hourstohuman怎么用?Python Utils.hourstohuman使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils.Utils的用法示例。


在下文中一共展示了Utils.hourstohuman方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: to_row

# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import hourstohuman [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]]
开发者ID:mbenitezm,项目名称:taskr,代码行数:18,代码来源:Task.py

示例2: to_row

# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import hourstohuman [as 别名]
 def to_row(self):
   end_time = Utils.datefmt(self.end_time) if self.end_time is not None else "-"
   start_time = Utils.datefmt(self.start_time)
   duration = Utils.hourstohuman(self.duration)
   cwd = self.cwd if hasattr(self, 'cwd') else "-"
   if not hasattr(self, 'commit_info'):
     self.commit_info = self.getGitInfo()
   return ["",start_time,end_time,duration,cwd,self.commit_info]
开发者ID:mbenitezm,项目名称:taskr,代码行数:10,代码来源:WorkSession.py

示例3: printWeeklog

# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import hourstohuman [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"
开发者ID:mbenitezm,项目名称:taskr,代码行数:17,代码来源:Taskr.py


注:本文中的Utils.Utils.hourstohuman方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。