plistsync.core.rewrite¶
Path rewriting utilities.
This module provides utilities for rewriting file paths in a consistent manner.
Overview¶
A tuple for managing and applying path rewriting rules. |
Module Contents¶
- class plistsync.core.rewrite.PathRewrite¶
Bases:
NamedTupleA tuple for managing and applying path rewriting rules.
- classmethod from_str(old: str, new: str) PathRewrite¶
Create a PathRewrite instance from string representations of paths.
- apply(path: T) T¶
Apply the rewrite rule to a given path.
- Parameters:
path (PurePath) – The path to be rewritten.
- property invert: PathRewrite¶
Invert the rewrite rule.