Skip to content

Commit

Permalink
correctly join paths and debug log the found results
Browse files Browse the repository at this point in the history
  • Loading branch information
vertti committed Feb 15, 2018
1 parent e3d2229 commit a1ba571
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions freqtrade/optimize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,20 @@ def load_tickerdata_file(datadir, pair, ticker_interval, timerange=None):
:return dict OR empty if unsuccesful
"""
path = make_testdata_path(datadir)
file = '{abspath}/{pair}-{ticker_interval}.json'.format(
abspath=path,
file = os.path.join(path, '{pair}-{ticker_interval}.json'.format(
pair=pair,
ticker_interval=ticker_interval,
)
))
gzipfile = file + '.gz'

# If the file does not exist we download it when None is returned.
# If file exists, read the file, load the json
if os.path.isfile(gzipfile):
logger.debug('Loading ticker data from file %s', gzipfile)
with gzip.open(gzipfile) as tickerdata:
pairdata = json.load(tickerdata)
elif os.path.isfile(file):
logger.debug('Loading ticker data from file %s', file)
with open(file) as tickerdata:
pairdata = json.load(tickerdata)
else:
Expand Down

0 comments on commit a1ba571

Please sign in to comment.