Changeset 38:fb741bfe9e1d in stamper
- Timestamp:
- Aug 12, 2014, 6:44:42 PM (10 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
bin/stamps
r37 r38 39 39 # Call the proper methods, based on the given parameters 40 40 if args.timeline: 41 s.timeline( )41 s.timeline(args.filter) 42 42 elif args.delete: 43 43 s.remove_stamps(args.delete) -
stamper/stamper.py
r37 r38 237 237 return details, totals, total_customer 238 238 239 def timeline(self): 239 def timeline(self, stamp_filter=None): 240 filter_from, filter_to = self.validate_filter(stamp_filter) 240 241 for stamp in self.stamps: 241 242 customer = stamp['customer'] 243 start = datetime.strptime(stamp['start'], DATETIME_FORMAT) 244 start_day = start.strftime('%Y-%m-%d') 245 if filter_from and start < filter_from: 246 # if there is a filter setting a starting date for the 247 # report and the current stamp is from an earlier date, do 248 # not add it to the totals 249 continue 250 if filter_to and start > filter_to: 251 # similar for the end date 252 continue 242 253 if not stamp['customer']: 243 254 print(stamp['start'] + ' start')
Note:
See TracChangeset
for help on using the changeset viewer.