| Rev | Line | |
|---|
| [0] | 1 | #!/usr/bin/env python
|
|---|
| 2 |
|
|---|
| [41] | 3 | from stamper.cli import build_args_parser
|
|---|
| [71] | 4 | from stamper.stamper import Stamper
|
|---|
| [0] | 5 |
|
|---|
| 6 |
|
|---|
| 7 | if __name__ == '__main__':
|
|---|
| 8 |
|
|---|
| [41] | 9 | parser = build_args_parser()
|
|---|
| [10] | 10 | args = parser.parse_args()
|
|---|
| 11 |
|
|---|
| [0] | 12 | s = Stamper()
|
|---|
| 13 | s.load_stamps()
|
|---|
| [29] | 14 |
|
|---|
| 15 | # Set proper arguments if they have passed a date-based filter without
|
|---|
| 16 | # a customer
|
|---|
| 17 | if args.customer not in s.customers and not args.filter:
|
|---|
| 18 | args.filter = args.customer
|
|---|
| 19 | args.customer = None
|
|---|
| 20 |
|
|---|
| 21 | # Call the proper methods, based on the given parameters
|
|---|
| [28] | 22 | if args.timeline:
|
|---|
| [61] | 23 | s.timeline(args.customer, args.filter, args.description)
|
|---|
| [32] | 24 | elif args.delete:
|
|---|
| 25 | s.remove_stamps(args.delete)
|
|---|
| [30] | 26 | elif args.graph:
|
|---|
| [61] | 27 | s.graph_stamps(args.customer, args.filter, args.description)
|
|---|
| [37] | 28 | elif args.import_file:
|
|---|
| 29 | s.import_stamps(args.import_file)
|
|---|
| [55] | 30 | elif args.push:
|
|---|
| [61] | 31 | s.push_stamps(args.customer, args.filter, args.description)
|
|---|
| [28] | 32 | else:
|
|---|
| [61] | 33 | s.show_stamps(args.customer, args.filter, args.verbose, args.sum,
|
|---|
| 34 | args.description)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.