Changeset 40:5d592e2950a1 in stamper
- Timestamp:
- Aug 12, 2014, 11:33:10 PM (10 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
bin/stamps
r38 r40 39 39 # Call the proper methods, based on the given parameters 40 40 if args.timeline: 41 s.timeline(args. filter)41 s.timeline(args.customer, args.filter) 42 42 elif args.delete: 43 43 s.remove_stamps(args.delete) -
stamper/stamper.py
r39 r40 237 237 return details, totals, total_customer 238 238 239 def timeline(self, stamp_filter=None):239 def timeline(self, customer=None, stamp_filter=None): 240 240 filter_from, filter_to = self.validate_filter(stamp_filter) 241 241 for stamp in self.stamps: 242 customer = stamp['customer']243 242 start = datetime.strptime(stamp['start'], DATETIME_FORMAT) 244 243 start_day = start.strftime('%Y-%m-%d') … … 251 250 # similar for the end date 252 251 continue 252 253 253 if not stamp['customer']: 254 print(stamp['start'] + ' start') 254 if customer is None: 255 print(stamp['start'] + ' start') 255 256 else: 257 if customer and customer != stamp['customer']: 258 continue 259 if customer: 260 print(stamp['start'] + ' start') 256 261 print(' '.join([stamp['end'], 257 262 stamp['customer'],
Note:
See TracChangeset
for help on using the changeset viewer.