First working notify version
This commit is contained in:
parent
ad3f49a785
commit
419fef8ddc
3 changed files with 61 additions and 5 deletions
|
|
@ -57,4 +57,4 @@ class DirectorySpec(Spec):
|
|||
)
|
||||
|
||||
if self.notifier:
|
||||
self.notifier.notify(process.returncode)
|
||||
self.notifier.notify("backup", self.name, process.returncode)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ class Spec:
|
|||
"notify": {
|
||||
"title": "Backup Notification",
|
||||
"events": ["backup_sucess"],
|
||||
"endpoint": None,
|
||||
"api_key": "",
|
||||
},
|
||||
"extension": "tar.gz",
|
||||
}
|
||||
|
|
@ -67,7 +69,7 @@ class Spec:
|
|||
"""
|
||||
|
||||
files = sorted(
|
||||
self.destination.glob(self.extension),
|
||||
self.destination.glob("*." + self.extension),
|
||||
key=os.path.getmtime,
|
||||
reverse=True,
|
||||
)
|
||||
|
|
@ -86,7 +88,6 @@ class Spec:
|
|||
def from_dict(cls, name, obj: Dict, defaults: Dict) -> Spec:
|
||||
# Combine defaults with skeleton, creating new skeleton
|
||||
skel = skeleton.merge(cls.skeleton(), defaults)
|
||||
print(skel)
|
||||
|
||||
# Then, combine actual values with new skeleton
|
||||
obj = skeleton.merge_with_skeleton(obj, skel)
|
||||
|
|
|
|||
Reference in a new issue