This repository has been archived by the owner on Jun 12, 2020. It is now read-only.
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.
Consolidate loaders #31
Open
Description
Almost all can be re-implemented in terms of recursive_glob
. Keep load_from_regex
for cases that need backtracking and add a fragment-matching function to search_folder
for the rest. Matchers for the phase/check syntax should clean up that ugly regex mess.
New usage:
# recursive_glob.py
def search_folder(folder, fragments, match_by=fnmatch, globstar_mode=False):
# ...
is_matching_folder = match_by(item, fragments[0])
# ...
# core/testing.py
def regex_matcher(fragment, pattern):
return re.search(pattern, fragment) is not None