Skip to content
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
Open
@bulatb

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

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions