Make data-finding safe
This commit is contained in:
parent
f8b8b9ac63
commit
ef0fcb0e0f
@ -19,8 +19,11 @@ class JsonDataHandler(IDataHandler):
|
||||
"""
|
||||
Returns a list of all pairs available in this datadir
|
||||
"""
|
||||
return [re.search(r'^(\S+)(?=\-' + timeframe + '.json)', p.name)[0].replace('_', ' /')
|
||||
|
||||
_tmp = [re.search(r'^(\S+)(?=\-' + timeframe + '.json)', p.name)
|
||||
for p in datadir.glob(f"*{timeframe}.{cls._get_file_extension()}")]
|
||||
# Check if regex found something and only return these results
|
||||
return [match[0].replace('_', ' /') for match in _tmp if match]
|
||||
|
||||
def ohlcv_store(self, timeframe: str, data: DataFrame):
|
||||
"""
|
||||
@ -54,8 +57,10 @@ class JsonDataHandler(IDataHandler):
|
||||
"""
|
||||
Returns a list of all pairs available in this datadir
|
||||
"""
|
||||
return [re.search(r'^(\S+)(?=\-trades.json)', p.name)[0].replace('_', '/')
|
||||
_tmp = [re.search(r'^(\S+)(?=\-trades.json)', p.name)
|
||||
for p in datadir.glob(f"*trades.{cls._get_file_extension()}")]
|
||||
# Check if regex found something and only return these results to avoid exceptions.
|
||||
return [match[0].replace('_', ' /') for match in _tmp if match]
|
||||
|
||||
def trades_store(self, data: List[Dict]):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user