class PathComparer:
OS-independent path comparison.
Windows path sep and posix path sep:
>>> '\to\index' == PathComparer('/to/index') True >>> '\to\index' == PathComparer('/to/index2') False
Windows path with drive letters
>>> 'C:\to\index' == PathComparer('/to/index') True >>> 'C:\to\index' == PathComparer('C:/to/index') True >>> 'C:\to\index' == PathComparer('D:/to/index') False
Method | __eq__ |
Undocumented |
Method | __init__ |
|
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | _diff |
Undocumented |
Method | diff |
compare self and other. |
Method | ldiff |
Undocumented |
Method | rdiff |
Undocumented |
Instance Variable | path |
Undocumented |
Undocumented
Parameters | |
other:Union[ | Undocumented |
Returns | |
bool | Undocumented |
Parameters | |
path:Union[ | Undocumented |
str path | path string, it will be cast as pathlib.Path. |
Undocumented
Parameters | |
lhs:pathlib.Path | Undocumented |
rhs:pathlib.Path | Undocumented |
Returns | |
List[ | Undocumented |
compare self and other.
When different is not exist, return empty list.
>>> PathComparer('/to/index').diff('C:\to\index') []
When different is exist, return unified diff style list as:
>>> PathComparer('/to/index').diff('C:\to\index2') [ '- C:/to/index' '+ C:/to/index2' '? +' ]
Parameters | |
other:Union[ | Undocumented |
Returns | |
List[ | Undocumented |
Undocumented
Parameters | |
other:Union[ | Undocumented |
Returns | |
List[ | Undocumented |