summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid McMackins II <contact@mcmackins.org>2016-05-25 14:21:07 -0500
committerDavid McMackins II <contact@mcmackins.org>2016-05-25 14:21:07 -0500
commit0f87e428b7f46fb5deeed36b793865f3ef44c4b2 (patch)
treec3eb359b828a9b604b72844af67ef59235db21d2
parentaf22a3b9a3f81ef82a418b2487c0ea9a46710911 (diff)
Remove unreachable exception block; fixes GitHub #1
-rw-r--r--cfetch/__init__.py2
-rwxr-xr-xcoinfetch13
2 files changed, 6 insertions, 9 deletions
diff --git a/cfetch/__init__.py b/cfetch/__init__.py
index 6e4f2de..40dea8d 100644
--- a/cfetch/__init__.py
+++ b/cfetch/__init__.py
@@ -21,7 +21,7 @@ from os.path import basename, dirname, exists, expanduser, isdir, join
from os.path import realpath
from requests import get
-__version__ = '5.1.0'
+__version__ = '5.1.1'
## A cryptocurrency exchange rate ticker.
class Ticker():
diff --git a/coinfetch b/coinfetch
index b3ded8e..7c9d06b 100755
--- a/coinfetch
+++ b/coinfetch
@@ -1,7 +1,7 @@
#! /usr/bin/env python3
##
## coinfetch - Cryptocurrency price fetcher
-## Copyright (C) 2015 Delwink, LLC
+## Copyright (C) 2015-2016 Delwink, LLC
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as published by
@@ -26,7 +26,7 @@ from os import makedirs
__title__ = 'coinfetch'
__author__ = 'David McMackins II'
__version_info__ = '''{} {}
-Copyright (C) 2015 Delwink, LLC
+Copyright (C) 2015-2016 Delwink, LLC
License AGPLv3: GNU AGPL version 3 only <http://gnu.org/licenses/agpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@@ -97,12 +97,9 @@ cli.add_argument('dest', help='currency to which to convert')
args = cli.parse_args()
try:
- print('%.8f' %get_ticker(args.api).get_rate(args.src, args.dest, args.amount))
-except KeyError:
- print('The API {} is not available. Currently installed APIs:'.format(args.api))
-
- list_sorted_apis()
- exit(10)
+ ticker = get_ticker(args.api)
+ rate = ticker.get_rate(args.src, args.dest, args.amount)
+ print(format(rate, '.8f'))
except ValueError:
pair = '/'.join([args.src, args.dest])
print('The pair {} was not found using the {} API.'.format(pair, args.api))