From 74efa794f8c743a6111bc205c89543255fe6f1e2 Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 31 Aug 2018 18:46:04 +0200 Subject: [PATCH] [wip] Repository functions descriptors --- src/yunohost/repository.py | 90 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 src/yunohost/repository.py diff --git a/src/yunohost/repository.py b/src/yunohost/repository.py new file mode 100644 index 000000000..e0d976a2d --- /dev/null +++ b/src/yunohost/repository.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- + +""" License + + Copyright (C) 2013 YunoHost + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program; if not, see http://www.gnu.org/licenses + +""" + +""" yunohost_repository.py + + Manage backup repositories +""" +import os +import re +import json +import errno +import time +import tarfile +import shutil +import subprocess + +from moulinette import msignals, m18n +from moulinette.core import MoulinetteError +from moulinette.utils import filesystem +from moulinette.utils.log import getActionLogger +from moulinette.utils.filesystem import read_file + +from yunohost.monitor import binary_to_human +from yunohost.log import OperationLogger + +BACKUP_PATH = '/home/yunohost.backup' +ARCHIVES_PATH = '%s/archives' % BACKUP_PATH +logger = getActionLogger('yunohost.backup') + + +def backup_repository_list(name): + """ + List available repositories where put archives + """ + pass + +def backup_repository_info(name): + """ + Show info about a repository + + Keyword arguments: + name -- Name of the backup repository + """ + pass + +def backup_repository_add(name): + """ + Add a backup repository + + Keyword arguments: + name -- Name of the backup repository + """ + pass + +def backup_repository_update(name): + """ + Update a backup repository + + Keyword arguments: + name -- Name of the backup repository + """ + pass + +def backup_repository_remove(name): + """ + Remove a backup repository + + Keyword arguments: + name -- Name of the backup repository to remove + + """ + pass