update relative paths on path change

This commit is contained in:
Maximilian Keßler 2022-02-05 19:38:42 +01:00
parent 15dd058f73
commit b6d0d935ff

View file

@ -28,10 +28,6 @@ class RelativePath(Path):
PyTeXRootDirType.DOC: GlobalPyTeXConfig.doc_root(),
PyTeXRootDirType.TEX_SOURCE: GlobalPyTeXConfig.tex_root()
}[self._pytex_root_dir_type]
try:
self._relative_path = self.relative_to(self._root_dir)
except ValueError as e:
raise NotImplementedError
@property
def root_dir_type(self) -> PyTeXRootDirType:
@ -43,7 +39,10 @@ class RelativePath(Path):
@property
def relative_path(self):
return self._relative_path
try:
return self.relative_to(self._root_dir)
except ValueError as e:
raise NotImplementedError
class RelativeWindowsPath(RelativePath, WindowsPath):