module documentation

Browsing related options and helpers.

Class BrowseFeature What to browse on a remote UA object.
Class BrowseRule Select which features to browse for matching objects.
Function browse_when Create a browse rule that applies features when a path matches.
Function evaluate_browse_features Evaluate the browse features applicable to an object.
Function match_all Match every object.
Function match_all_of Match when all the given predicates match.
Function match_any Match when any of the given predicates match.
Function match_name Match objects by name.
Function match_not Negate a match predicate.
Function match_path Match an exact path.
Function match_path_prefix Match a path and all of its descendants.
Constant DEFAULT_BROWSE_RULE Undocumented
Type Alias BrowseMatcher Undocumented
def browse_when(match: BrowseMatcher, *features: BrowseFeature) -> BrowseRule:

Create a browse rule that applies features when a path matches.

Multiple features are combined into a single BrowseFeature using bitwise OR.

def evaluate_browse_features(rules: Iterable[BrowseRule], path: PurePosixPath) -> BrowseFeature:

Evaluate the browse features applicable to an object.

All matching rules contribute their features, which are combined using bitwise OR. Returns BrowseFeature(0) when no rules match.

def match_all(_path: PurePosixPath) -> bool:

Match every object.

def match_all_of(*matches: BrowseMatcher) -> BrowseMatcher:

Match when all the given predicates match.

def match_any(*matches: BrowseMatcher) -> BrowseMatcher:

Match when any of the given predicates match.

def match_name(name: str) -> BrowseMatcher:

Match objects by name.

def match_not(match: BrowseMatcher) -> BrowseMatcher:

Negate a match predicate.

def match_path(path: PurePosixPath | str) -> BrowseMatcher:

Match an exact path.

def match_path_prefix(prefix: PurePosixPath | str) -> BrowseMatcher:

Match a path and all of its descendants.

DEFAULT_BROWSE_RULE: BrowseRule =

Undocumented

Value
BrowseRule(match=match_all, features=(~BrowseFeature(0)))
BrowseMatcher: TypeAlias =

Undocumented

Value
Callable[[PurePosixPath], bool]