write delta, not end time

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-08-02 08:30:46 +02:00
parent cb1e9aec54
commit 5d0580d930
1 changed files with 7 additions and 4 deletions

11
ctt.py
View File

@ -56,19 +56,22 @@ class CTT:
start_seconds = self.start.strftime("%s")
stop_seconds = self.stop.strftime("%s")
delta_seconds = self.duration().total_seconds()
time_dir = os.path.join(self.project_dir, start_seconds)
os.makedirs(time_dir, mode=0o700, exist_ok=True)
filename = os.path.join(time_dir, "end")
filename = os.path.join(time_dir, "delta")
with open(filename, "w") as fd:
fd.write("%s\n" % stop_seconds)
fd.write("%s\n" % delta_seconds)
def duration(self):
def delta(self):
if self.tracked_time:
delta = self.stop - self.start
else:
delta = 0
delta = datetime.timedelta()
return delta