Skip to content

Commit

Permalink
Adding details about tasks : comment and total duration of the day
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Duyé committed May 12, 2014
1 parent 7942fb1 commit 52d34e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion redminetimesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ def getTimeEntries(time_entries, verbose=True):
else:
default_activity_id = None
array = []
total_duration = 0
for time_entry in time_entries:
label = time_entry[0]
duration = calDuration(time_entry[2], time_entry[1])
total_duration += duration
comment = time_entry[3]
# Try to find Redmine issue IDs from label using regexp defined in config file
match = re.match(configProperties.get('default', 'issue_id_regexp'), label)
if match:
Expand All @@ -72,6 +75,8 @@ def getTimeEntries(time_entries, verbose=True):
print u"* [{duration}h] #{id} : {label}".format(
duration=duration, id=issue_id, label=label
)
if comment is not None:
print u" {}".format(comment)
# Try to find activity_id
category_name = time_entry[4]
if category_name is not None and categories_association is not None:
Expand All @@ -96,9 +101,10 @@ def getTimeEntries(time_entries, verbose=True):
'label': label,
'issue_id': issue_id,
'duration': duration,
'comment': time_entry[3],
'comment': comment,
'activity_id': activity_id
})
print "\nTotal : {}h".format(total_duration)
return array

def generateXml(time_entries, date):
Expand Down

0 comments on commit 52d34e2

Please sign in to comment.