Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import pathlib
- import inspect
- class EPosixPath(pathlib.PosixPath):
- def relpath(self, other):
- return self.__class__(os.path.relpath(self, other))
- def is_hidden(self):
- '''
- Returns True if the file or dir is hidden.
- '''
- return str(self.name).startswith('.')
- EPosixPath.relpath.__doc__ = inspect.getdoc(os.path.relpath)
- pathlib.PosixPath = EPosixPath
- Path = pathlib.Path
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement