virtual_path.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from pathlib import Path, PurePath
  2. from dataclasses import dataclass
  3. from typing import Union
  4. from transparentpath import TransparentPath
  5. @dataclass
  6. class VirtualPathEntry:
  7. pass
  8. class VirtualPath(Path):
  9. def cwd(self):
  10. pass
  11. def exists(self):
  12. pass
  13. def glob(self):
  14. pass
  15. def is_dir(self):
  16. pass
  17. def is_file(self):
  18. pass
  19. def iterdir(self):
  20. pass
  21. def lstat(self):
  22. return self.stat()
  23. def open(self):
  24. pass
  25. def stat(self):
  26. pass
  27. # ['__bytes__', '__class__', '__class_getitem__', '__delattr__', '__dir__', '__doc__', '__enter__', '__eq__', '__exit__', '__format__',
  28. # '__fspath__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__',
  29. # '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rtruediv__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '__truediv__',
  30. # '_accessor', '_cached_cparts', '_cparts', '_drv', '_format_parsed_parts', '_from_parsed_parts', '_from_parts', '_hash', '_init',
  31. # '_make_child', '_make_child_relpath', '_opener', '_parse_args', '_parts', '_pparts', '_raw_open', '_root', '_str',
  32. # 'absolute', 'anchor', 'as_posix', 'as_uri', 'chmod', 'cwd', 'drive', 'exists', 'expanduser', 'glob', 'group', 'home', 'is_absolute',
  33. # 'is_block_device', 'is_char_device', 'is_dir', 'is_fifo', 'is_file', 'is_mount', 'is_relative_to', 'is_reserved', 'is_socket', 'is_symlink',
  34. # 'iterdir', 'joinpath', 'lchmod', 'link_to', 'lstat', 'match', 'mkdir', 'name', 'open', 'owner', 'parent', 'parents', 'parts',
  35. # 'read_bytes', 'read_text', 'readlink', 'relative_to', 'rename', 'replace', 'resolve', 'rglob', 'rmdir', 'root', 'samefile', 'stat',
  36. # 'stem', 'suffix', 'suffixes', 'symlink_to', 'touch', 'unlink', 'with_name', 'with_stem', 'with_suffix', 'write_bytes', 'write_text']