Changeset 39:1c05c2acebc9 in stamper for stamper


Ignore:
Timestamp:
Aug 12, 2014, 6:47:13 PM (10 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Show per-customer totals per day in the verbose/details results.
If there are more than one customer to report, show also the total
time for the day.
Adapt the verbose/details results layout to be similar to the one
generated by betabug's stamp tool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stamper/stamper.py

    r38 r39  
    222222                worktime = self.worktime(stamp['start'], stamp['end'])
    223223                details[start_day].append(
    224                     ' -> %(worktime)s %(customer)s %(action)s' % {
     224                    '%(worktime)s %(customer)s %(action)s' % {
    225225                        'worktime': str(timedelta(seconds=worktime)),
    226226                        'customer': customer,
     
    318318                for line in details[day]:
    319319                    print(line)
    320                 print(' Total: %(total)s' % {'total': totals[day]})
     320                customer_day_totals = []
     321                for tc in total_customer[day]:
     322                    tc_total = str(timedelta(seconds=total_customer[day][tc]))
     323                    customer_day_totals.append(tc+': '+tc_total)
     324                print(', '.join(customer_day_totals))
     325                if len(customer_day_totals) > 1:
     326                    # if there are multiple customers in the report, show the
     327                    # daily totals
     328                    print('daily total: %(total)s' % {'total': totals[day]})
    321329            print '-'*79
    322330
Note: See TracChangeset for help on using the changeset viewer.