appease the linter
This commit is contained in:
parent
35749eb0bd
commit
8ff527b88a
9
crawl.py
9
crawl.py
@ -52,6 +52,7 @@ parser.add_argument(
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--cache-dir',
|
'--cache-dir',
|
||||||
dest='cache_dir',
|
dest='cache_dir',
|
||||||
|
type=str,
|
||||||
help='Override the default cache directory with your own path'
|
help='Override the default cache directory with your own path'
|
||||||
)
|
)
|
||||||
exc_group = parser.add_mutually_exclusive_group()
|
exc_group = parser.add_mutually_exclusive_group()
|
||||||
@ -78,23 +79,23 @@ vals_group.add_argument(
|
|||||||
|
|
||||||
|
|
||||||
def _process_stdin(argv: str, res: utils.CurrencyResult) -> None:
|
def _process_stdin(argv: str, res: utils.CurrencyResult) -> None:
|
||||||
argv=argv.split()
|
argv = argv.split()
|
||||||
try:
|
try:
|
||||||
if argv[0] in ['q', 'exit', 'quit']:
|
if argv[0] in ['q', 'exit', 'quit']:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
elif argv[0] in ['date', 'd']:
|
elif argv[0] in ['date', 'd']:
|
||||||
print(res.date)
|
print(res.date)
|
||||||
elif len(argv[0])==3 or len(argv[1])==3:
|
elif len(argv[0]) == 3 or len(argv[1]) == 3:
|
||||||
# more than 3 letter abbreviations are invalid
|
# more than 3 letter abbreviations are invalid
|
||||||
if is_float(argv[0]):
|
if is_float(argv[0]):
|
||||||
# amount first -> convert to currency in argv[1]
|
# amount first -> convert to currency in argv[1]
|
||||||
print(fmt_and_calc(
|
print(fmt_and_calc(
|
||||||
cur=argv[1].upper(),
|
cur=argv[1].upper(),
|
||||||
amt=float(argv[0]),
|
amt=float(argv[0]),
|
||||||
res=res,
|
res=res,
|
||||||
direction=DIRECTION_FROM_EUR))
|
direction=DIRECTION_FROM_EUR))
|
||||||
elif is_float(argv[1]):
|
elif is_float(argv[1]):
|
||||||
# currency first -> convert to EUR
|
# currency first -> convert to EUR
|
||||||
print(fmt_and_calc(
|
print(fmt_and_calc(
|
||||||
cur=argv[0].upper(),
|
cur=argv[0].upper(),
|
||||||
amt=float(argv[1]),
|
amt=float(argv[1]),
|
||||||
|
Loading…
Reference in New Issue
Block a user