completed more

This commit is contained in:
Hellow2
2023-03-30 15:28:23 +02:00
parent fc98998cdb
commit fab76fc165
2 changed files with 22 additions and 0 deletions

View File

@@ -51,3 +51,12 @@ class Target(DatabaseObject):
def create_path(self):
self._path.mkdir(parents=True, exist_ok=True)
def copy_content(self, copy_to: "Target"):
if not self.exists:
return
with open(self.file_path, "rb") as read_from:
copy_to.create_path()
with open(self.file_path, "wb") as write_to:
write_to.write(read_from.read())