-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
pymkm.py
58 lines (50 loc) · 1.39 KB
/
pymkm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is a working app for showcasing the PyMKM module.
"""
__author__ = "Andreas Ehrlund"
__version__ = "2.5.1"
__license__ = "MIT"
import argparse
from pymkm.pymkm_app import PyMkmApp
def main():
parser = argparse.ArgumentParser(description="pymkm command line interface.")
parser.add_argument("--version", action="version", version=__version__)
parser.add_argument(
"--update_stock",
action="store_true",
help="Update stock prices. Use --partial if needed.",
)
parser.add_argument(
"--partial",
metavar="<number>",
type=int,
default=0,
help="Used for partial updates of for example stock.",
)
parser.add_argument(
"--price_check_wantslist",
metavar="<wantslist name>",
type=str,
help="Run the Track price data to csv option.",
)
parser.add_argument(
"--cached",
dest="cached",
action="store_true",
help="Use cached values if available.",
)
parser.add_argument(
"--no-cached",
dest="cached",
action="store_false",
help="Don't use cached values.",
)
parser.set_defaults(cached=True)
args = parser.parse_args()
app = PyMkmApp()
app.start(args)
if __name__ == "__main__":
""" This is executed when run from the command line """
main()