class PathComparer: (source)
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__ |
:param str path: path string, it will be cast as pathlib.Path. |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | diff |
compare self and other. |
Method | ldiff |
Undocumented |
Method | rdiff |
Undocumented |
Instance Variable | path |
Undocumented |
Method | _diff |
Undocumented |
:param str path: path string, it will be cast as pathlib.Path.
Parameters | |
path:str|pathlib.Path | 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:str|pathlib.Path | Undocumented |
Returns | |
list[ | Undocumented |
Undocumented
Parameters | |
lhs:pathlib.Path | Undocumented |
rhs:pathlib.Path | Undocumented |
Returns | |
list[ | Undocumented |