missing = object()
-__all__ = ['distinct', 'pathmatch', 'relpath', 'wraptext', 'odict', 'UTC',
- 'LOCALTZ']
-
def distinct(iterable):
"""Yield all items in an iterable collection that are distinct.
['f', 'o', 'b', 'a', 'r']
:param iterable: the iterable collection providing the data
- :return: the distinct items in the collection
- :rtype: ``iterator``
"""
seen = set()
for item in iter(iterable):
:param pattern: the glob pattern
:param filename: the path name of the file to match against
- :return: `True` if the path name matches the pattern, `False` otherwise
- :rtype: `bool`
"""
symbols = {
'?': '[^/]',
wrapped output
:param subsequent_indent: string that will be prepended to all lines save
the first of wrapped output
- :return: a list of lines
- :rtype: `list`
"""
wrapper = TextWrapper(width=width, initial_indent=initial_indent,
subsequent_indent=subsequent_indent,
'bar.txt'
>>> relpath('foo/bar.txt', 'baz').replace(os.sep, '/')
'../foo/bar.txt'
-
- :return: the relative path
"""
start_list = os.path.abspath(start).split(os.sep)
path_list = os.path.abspath(path).split(os.sep)