Generalize "path" variables for resolvers

This commit is contained in:
Matthias
2022-10-14 19:49:06 +02:00
parent 2ef315e8c2
commit 4bfe58706b
3 changed files with 7 additions and 9 deletions

View File

@@ -30,6 +30,7 @@ class StrategyResolver(IResolver):
object_type_str = "Strategy"
user_subdir = USERPATH_STRATEGIES
initial_search_path = None
extra_path = "strategy_path"
@staticmethod
def load_strategy(config: Config = None) -> IStrategy:
@@ -268,14 +269,6 @@ class StrategyResolver(IResolver):
"or contains Python code errors."
)
@classmethod
def build_search_paths(cls, config: Config, user_subdir: Optional[str] = None,
extra_dirs: List[str] = []) -> List[Path]:
if 'strategy_path' in config and config['strategy_path'] not in extra_dirs:
extra_dirs = [config['strategy_path']] + extra_dirs
return super().build_search_paths(config, user_subdir, extra_dirs)
def warn_deprecated_setting(strategy: IStrategy, old: str, new: str, error=False):
if hasattr(strategy, old):