def get_path(self): if self._path is None: if self.is_root_node(): self._path = self.short_name else: self._path = join_paths(self.parent.get_path(), self.short_name) if self._connected_parent != self.parent: if self._connected_parent is not None: self._connected_parent._path_changed.disconnect( self._parent_path_changed_callback) if self.parent is not None: self.parent._path_changed.connect( self._parent_path_changed_callback) self._connected_parent = self.parent return self._path
def _parent_path_changed_callback(self, sender, path, **kwargs): self._path = join_paths(path, self.short_name) self._path_changed.send(self, path=self._path)