historical: Switch to relative import.
This commit is contained in:
parent
18f7ea7038
commit
f9c045a63e
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
import oxrlib.rate
|
from .. import rate as oxrrate
|
||||||
|
|
||||||
def format_one_rate(rate, from_amt, from_curr, to_curr):
|
def format_one_rate(rate, from_amt, from_curr, to_curr):
|
||||||
return "{:g} {} = {:g} {}".format(
|
return "{:g} {} = {:g} {}".format(
|
||||||
|
@ -11,7 +11,7 @@ def format_rate_pair(rate, from_curr, to_curr):
|
||||||
def run(config, stdout, stderr):
|
def run(config, stdout, stderr):
|
||||||
loaders = config.get_loaders()
|
loaders = config.get_loaders()
|
||||||
with loaders.historical(config.args.date, config.args.base) as rate_json:
|
with loaders.historical(config.args.date, config.args.base) as rate_json:
|
||||||
rate = oxrlib.rate.Rate.from_json_file(rate_json)
|
rate = oxrrate.Rate.from_json_file(rate_json)
|
||||||
if not config.args.from_currency:
|
if not config.args.from_currency:
|
||||||
for from_curr in sorted(rate.rates):
|
for from_curr in sorted(rate.rates):
|
||||||
print(*format_rate_pair(rate, from_curr, config.args.to_currency),
|
print(*format_rate_pair(rate, from_curr, config.args.to_currency),
|
||||||
|
|
Loading…
Reference in a new issue