update relative paths on path change
This commit is contained in:
parent
15dd058f73
commit
b6d0d935ff
1 changed files with 4 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue