From: Michael Tremer Date: Fri, 12 Feb 2021 16:58:36 +0000 (+0000) Subject: Drop old repository template code X-Git-Tag: 0.9.28~1285^2~749 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a0d90f1c03f99d003b09320e5cceb667ab1aa872;p=pakfire.git Drop old repository template code Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 94074048d..7d6272c9d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -157,7 +157,6 @@ pakfire_packagesdir = $(pythondir)/pakfire/packages pakfire_repository_PYTHON = \ src/pakfire/repository/__init__.py \ - src/pakfire/repository/base.py \ src/pakfire/repository/metadata.py pakfire_repositorydir = $(pythondir)/pakfire/repository diff --git a/src/pakfire/repository/base.py b/src/pakfire/repository/base.py deleted file mode 100644 index ded31c5a2..000000000 --- a/src/pakfire/repository/base.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/python -############################################################################### -# # -# Pakfire - The IPFire package management system # -# Copyright (C) 2011 Pakfire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU 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 General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see . # -# # -############################################################################### - -import logging -log = logging.getLogger("pakfire") - -from .. import _pakfire - -from . import packages - -class RepositoryFactory(_pakfire.Repo): - def __init__(self, pakfire, name, description, **kwargs): - self.pakfire = pakfire - - # Inherit - _pakfire.Repo.__init__(self, self.pakfire, name) - - # Save description - self.description = description - - log.debug("Initialized new repository: %s" % self) - - # Marks if this repository has been opened. - self.opened = False - - self.init(**kwargs) - - def __repr__(self): - return "<%s %s>" % (self.__class__.__name__, self.name) - - def init(self, **kwargs): - pass # To be overwritten by inheriting classes - - @property - def local(self): - """ - Say if a repository is a local one or remotely located. - - Used to check if we need to download files. - """ - return False - - def open(self): - """ - Opens the repository, so we can work with the data. - """ - self.opened = True - - def close(self): - """ - Close and delete all resources that are used by this repository. - """ - self.opened = False - - def dump(self, long=False, filelist=False): - dumps = [] - # Dump all package information of the packages in this repository. - for pkg in self: - dump = pkg.dump(int=int, filelist=filelist) - dumps.append(dump) - - return "\n\n".join(dumps)