示例#1
0
 def output(r):
     print "worked on %s" % colored(r[0], attrs=['bold'])
     print "  from    %s" % colored(
         server.date_to_txt(r[1][0], time_format), 'green')
     print "  to now, %s" % colored(
         server.date_to_txt(r[1][1], time_format), 'green')
     print "       => %s elapsed" % colored(
         time_elapsed(r[1][0], r[1][1]), 'red')
示例#2
0
 def output(r):
   print "worked on %s" % colored(r[0], attrs=['bold'])
   print "  from    %s" % colored(
     server.date_to_txt(r[1][0], time_format), 'green')
   print "  to now, %s" % colored(
     server.date_to_txt(r[1][1], time_format), 'green')
   print "       => %s elapsed" % colored(
     time_elapsed(r[1][0], r[1][1]), 'red')
示例#3
0
def status(logfile, time_format):
  "show current status"

  try:
    r = read(logfile, time_format)[-1]
    if r[1][1]:
      return summary(logfile, time_format)
    else:
      print "working on %s" % colored(r[0], attrs=['bold'])
      print "  since    %s" % colored(
        server.date_to_txt(r[1][0], time_format), 'green')
      print "  to now,  %s" % colored(
        server.date_to_txt(now(), time_format), 'green')
      print "        => %s elapsed" % colored(time_elapsed(r[1][0]), 'red')
  except IndexError:
    return cmdapp.help()
示例#4
0
def start(project, logfile, time_format):
    "start tracking for <project>"

    write(server.start(project, read(logfile, time_format)), logfile,
          time_format)

    print "starting work on %s" % colored(project, attrs=['bold'])
    print "  at %s" % colored(server.date_to_txt(now(), time_format), 'green')
示例#5
0
文件: client.py 项目: omarkhan/timed
def start(project, logfile, time_format):
  "start tracking for <project>"

  write(server.start(project, read(logfile, time_format)),
    logfile, time_format)

  print "starting work on %s" % colored(project, attrs=['bold'])
  print "  at %s" % colored(server.date_to_txt(now(), time_format), 'green')
示例#6
0
文件: client.py 项目: oz123/timed
def start(project, logfile, time_format):
  "start tracking for <project>"
  records = read(logfile, time_format)
  if records and not records[-1][1][1]:
    print "error: there is a project already active"
    return

  write(server.start(project, records), logfile, time_format)

  print "starting work on %s" % colored(project, attrs=['bold'])
  print "  at %s" % colored(server.date_to_txt(now(), time_format), 'green')
示例#7
0
def start(project, logfile, time_format):
    "start tracking for <project>"
    records = read(logfile, time_format)
    if records and not records[-1][1][1]:
        print "error: there is a project already active"
        return

    write(server.start(project, records), logfile, time_format)

    print "starting work on %s" % colored(project, attrs=['bold'])
    print "  at %s" % colored(server.date_to_txt(now(), time_format), 'green')