appease the linter

This commit is contained in:
Christopher Teutsch 2019-05-04 19:30:25 +02:00
parent 35749eb0bd
commit 8ff527b88a
Signed by: iwonder
GPG Key ID: 0EE33D788D50130D

View File

@ -52,6 +52,7 @@ parser.add_argument(
parser.add_argument(
'--cache-dir',
dest='cache_dir',
type=str,
help='Override the default cache directory with your own path'
)
exc_group = parser.add_mutually_exclusive_group()
@ -78,23 +79,23 @@ vals_group.add_argument(
def _process_stdin(argv: str, res: utils.CurrencyResult) -> None:
argv=argv.split()
argv = argv.split()
try:
if argv[0] in ['q', 'exit', 'quit']:
sys.exit()
elif argv[0] in ['date', 'd']:
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
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(
cur=argv[1].upper(),
amt=float(argv[0]),
res=res,
direction=DIRECTION_FROM_EUR))
elif is_float(argv[1]):
# currency first -> convert to EUR
# currency first -> convert to EUR
print(fmt_and_calc(
cur=argv[0].upper(),
amt=float(argv[1]),