update description about path.is_super_path

This commit is contained in:
Prodesire 2018-01-27 11:07:56 +08:00
parent 4f534879b2
commit d79251168d
2 changed files with 4 additions and 4 deletions

View File

@ -16,8 +16,8 @@ Path
Note that if ``path1`` is same as ``path2``, it's also regarded as
the super path os ``path2``.
For instance "/opt" is the super path of "/opt/test",
While "/opt/t" is the super path of "/opt/test"
For instance "/", "/opt" and "/opt/test" are all the super paths of "/opt/test",
while "/opt/t" is the super path of "/opt/test".
>>> from pydu.path import is_super_path
>>> is_super_path('/aa/bb/cc', '/aa/bb/cc')

View File

@ -18,8 +18,8 @@ def is_super_path(path1, path2):
Whether `path1` is the super path of `path2`.
Note that if `path1` is same as `path2`, it's also regarded as
the super path os `path2`.
For instance "/opt" is the super path of "/opt/test",
While "/opt/t" is the super path of "/opt/test"
For instance "/", "/opt" and "/opt/test" are all the super paths of "/opt/test",
while "/opt/t" is the super path of "/opt/test".
"""
path1 = os.path.normpath(path1)
current_path2 = os.path.normpath(path2)