Changeset 37:abe2ef05ce80 in stamper for bin/stamps


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

Added feature to import stamps from a file:

stamps -i /path/to/stamps.json

The stamps file is read, stamps are loaded and then merged into the
main stamps stream, keeping proper order (by start, end dates)
and removing duplicated entries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/stamps

    r32 r37  
    2323    parser.add_argument('-d', '--delete', action="store", type=int,
    2424                        help='Delete up to n recorded stamps')
     25    parser.add_argument('-i', '--import', action="store", dest="import_file",
     26                        help='Import stamps from the given file')
    2527
    2628    args = parser.parse_args()
     
    4244    elif args.graph:
    4345        s.graph_stamps(args.customer, args.filter)
     46    elif args.import_file:
     47        s.import_stamps(args.import_file)
    4448    else:
    4549        s.show_stamps(args.customer, args.filter, args.verbose, args.sum)
Note: See TracChangeset for help on using the changeset viewer.