Beispiel #1
0
    def connect(self, credential: Credential):
        opts = {"webdav_hostname": credential.url, 
        "webdav_login": credential.login,
        "webdav_password": credential.password}

        try:
            self.__client = wclient.Client(opts)
            Log.Info("Connection established with the remote storage")
        except:
            Log.Error("Failed to connet to your webdav storage. Verify your configuration")
Beispiel #2
0
    def removeRessource(self, path: str, on_remote=False):
        p = fullPath(path)
        if on_remote and self.__client.exists(p):
            self.__client.remove(p)

        if str(p) not in self.__config.data_to_save:
            Log.Error(
                "You try to delete file which is not in the webdav_backup registry"
            )
            return
        self.__config.data_to_save.remove(str(p))
        self.__config.save()