class documentation

class PathComparer: (source)

View In Hierarchy

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
def __eq__(self, other): (source)

Undocumented

Parameters
other:str|pathlib.PathUndocumented
Returns
boolUndocumented
def __init__(self, path): (source)

:param str path: path string, it will be cast as pathlib.Path.

Parameters
path:str|pathlib.PathUndocumented
def __repr__(self): (source)

Undocumented

Returns
strUndocumented
def __str__(self): (source)

Undocumented

Returns
strUndocumented
def diff(self, other): (source)

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.PathUndocumented
Returns
list[str]Undocumented
def ldiff(self, other): (source)

Undocumented

Parameters
other:str|pathlib.PathUndocumented
Returns
list[str]Undocumented
def rdiff(self, other): (source)

Undocumented

Parameters
other:str|pathlib.PathUndocumented
Returns
list[str]Undocumented

Undocumented

def _diff(self, lhs, rhs): (source)

Undocumented

Parameters
lhs:pathlib.PathUndocumented
rhs:pathlib.PathUndocumented
Returns
list[str]Undocumented