Added suppoort for regex in whitelist
This commit is contained in:
@@ -59,6 +59,11 @@ class PairListManager():
|
||||
"""The expanded blacklist (including wildcard expansion)"""
|
||||
return expand_pairlist(self._blacklist, self._exchange.get_markets().keys())
|
||||
|
||||
@property
|
||||
def expanded_whitelist(self) -> List[str]:
|
||||
"""The expanded whitelist (including wildcard expansion)"""
|
||||
return expand_pairlist(self._whitelist, self._exchange.get_markets().keys())
|
||||
|
||||
@property
|
||||
def name_list(self) -> List[str]:
|
||||
"""Get list of loaded Pairlist Handler names"""
|
||||
@@ -129,6 +134,21 @@ class PairListManager():
|
||||
pairlist.remove(pair)
|
||||
return pairlist
|
||||
|
||||
def verify_whitelist(self, pairlist: List[str], logmethod) -> List[str]:
|
||||
"""
|
||||
Verify and remove items from pairlist - returning a filtered pairlist.
|
||||
Logs a warning or info depending on `aswarning`.
|
||||
Pairlist Handlers explicitly using this method shall use
|
||||
`logmethod=logger.info` to avoid spamming with warning messages
|
||||
:return: pairlist - blacklisted pairs
|
||||
"""
|
||||
try:
|
||||
whitelist = self.expanded_whitelist
|
||||
except ValueError as err:
|
||||
logger.error(f"Pair blacklist contains an invalid Wildcard: {err}")
|
||||
return []
|
||||
return whitelist
|
||||
|
||||
def create_pair_list(self, pairs: List[str], timeframe: str = None) -> ListPairsWithTimeframes:
|
||||
"""
|
||||
Create list of pair tuples with (pair, timeframe)
|
||||
|
Reference in New Issue
Block a user