@contextmanagerdefopen(self,mode:Literal["rb","r"]="r"):"""Open the file and return a file object (default to text mode)."""withsuper().open(mode=mode)asstream:yieldstream
defsave(self,destination:str):"""Writes it's content to destination"""destination=stringify_path(destination)client:Client=self._catalog.get_client(destination)withclient.fs.open(destination,mode="w")asf:f.write(self.read_text())