Lines Matching refs:self
16 def __init__(self, loader):
17 self.path = pathlib.Path(loader.path).parent
19 def resource_path(self, resource):
25 return str(self.path.joinpath(resource))
27 def files(self):
28 return self.path
32 def __init__(self, loader, module):
34 self.prefix = loader.prefix.replace('\\', '/') + name + '/'
35 self.archive = loader.archive
37 def open_resource(self, resource):
43 def is_resource(self, path):
46 target = self.files().joinpath(path)
49 def files(self):
50 return zipfile.Path(self.archive, self.prefix)
61 def __init__(self, *paths):
62 self._paths = list(map(pathlib.Path, remove_duplicates(paths)))
63 if not self._paths:
66 if not all(path.is_dir() for path in self._paths):
69 def iterdir(self):
70 files = (file for path in self._paths for file in path.iterdir())
73 def read_bytes(self):
74 raise FileNotFoundError(f'{self} is not a file')
76 def read_text(self, *args, **kwargs):
77 raise FileNotFoundError(f'{self} is not a file')
79 def is_dir(self):
82 def is_file(self):
85 def joinpath(self, child):
87 for file in self.iterdir():
91 return self._paths[0] / child
95 def open(self, *args, **kwargs):
96 raise FileNotFoundError(f'{self} is not a file')
99 def name(self):
100 return self._paths[0].name
102 def __repr__(self):
103 paths = ', '.join(f"'{path}'" for path in self._paths)
108 def __init__(self, namespace_path):
111 self.path = MultiplexedPath(*list(namespace_path))
113 def resource_path(self, resource):
119 return str(self.path.joinpath(resource))
121 def files(self):
122 return self.path