monsterwell/classes/directory.py
2023-01-09 17:18:59 +00:00

11 lines
No EOL
516 B
Python

class Directory:
def __init__(self, name, source, destination, sourcebackup=None, destinationbackup=None):
self.name = name
self.source = source
self.destination = destination
self.sourcebackup = sourcebackup
self.destinationbackup = destinationbackup
@classmethod
def from_config(cls, section):
return cls(section.name.split()[1], section["SourceDirectory"], section["DestinationDirectory"], section.get("SourceBackup"), section.get("DestinationBackup"))