4:0 ˆ¾Ã 0ÂÁÀ 7 � 355_•I|¥‰ÓMjqØ‚¦ ë<óo¬a–ß=¿JJj"Tâ�ÆZ¸'”ţ c
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
# ˆl–ß=¿JJj"Tâ€vàZ¸©‹FÿÆ ƒh¹Å¿Ã 0 $ ˆl–Ãa¾”ên-j� ÁàYS�ÿÇ „m>ׯÀÄ <† # -*- coding: utf-8 -*- # Copyright (C) 2017-2018 Red Hat, Inc. # # 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 2 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 Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # import libdnf.transaction import dnf.db.history import dnf.transaction import dnf.exceptions from dnf.i18n import _ from dnf.util import logger import rpm class PersistorBase(object): def __init__(self, history): assert isinstance(history, dnf.db.history.SwdbInterface), str(type(history)) self.history = history self._installed = {} self._removed = {} self._upgraded = {} self._downgraded = {} def __len__(self): return len(self._installed) + len(self._removed) + len(self._upgraded) + len(self._downgraded) def clean(self): self._installed = {} self._removed = {} self._upgraded = {} self._downgraded = {} def _get_obj_id(self, obj): raise NotImplementedError def _add_to_history(self, item, action): ti = self.history.swdb.addItem(item, "", action, libdnf.transaction.TransactionItemReason_USER) ti.setState(libdnf.transaction.TransactionItemState_DONE) def install(self, obj): self._installed[self._get_obj_id(obj)] = obj self._add_to_history(obj, libdnf.transaction.TransactionItemAction_INSTALL) def remove(self, obj): self._removed[self._get_obj_id(obj)] = obj self._add_to_history(obj, libdnf.transaction.TransactionItemAction_REMOVE) def upgrade(self, obj): self._upgraded[self._get_obj_id(obj)] = obj self._add_to_history(obj, libdnf.transaction.TransactionItemAction_UPGRADE) def downgrade(self, obj): self._downgraded[self._get_obj_id(obj)] = obj self._add_to_history(obj, libdnf.transaction.TransactionItemAction_DOWNGRADE) def new(self, obj_id, name, translated_name, pkg_types): raise NotImplementedError def get(self, obj_id): raise NotImplementedError def search_by_pattern(self, pattern): raise NotImplementedError class GroupPersistor(PersistorBase): def __iter__(self): items = self.history.swdb.getItems() items = [i for i in items if i.getCompsGroupItem()] return iter(items) def _get_obj_id(self, obj): return obj.getGroupId() def new(self, obj_id, name, translated_name, pkg_types): swdb_group = self.history.swdb.createCompsGroupItem() swdb_group.setGroupId(obj_id) if name is not None: swdb_group.setName(name) if translated_name is not None: swdb_group.setTranslatedName(translated_name) swdb_group.setPackageTypes(pkg_types) return swdb_group def get(self, obj_id): swdb_group = self.history.swdb.getCompsGroupItem(obj_id) if not swdb_group: return None swdb_group = swdb_group.getCompsGroupItem()