Blame doc/api_comps.rst

Packit 6f3914
..
Packit 6f3914
  Copyright (C) 2014-2018 Red Hat, Inc.
Packit 6f3914
Packit 6f3914
  This copyrighted material is made available to anyone wishing to use,
Packit 6f3914
  modify, copy, or redistribute it subject to the terms and conditions of
Packit 6f3914
  the GNU General Public License v.2, or (at your option) any later version.
Packit 6f3914
  This program is distributed in the hope that it will be useful, but WITHOUT
Packit 6f3914
  ANY WARRANTY expressed or implied, including the implied warranties of
Packit 6f3914
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Packit 6f3914
  Public License for more details.  You should have received a copy of the
Packit 6f3914
  GNU General Public License along with this program; if not, write to the
Packit 6f3914
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit 6f3914
  02110-1301, USA.  Any Red Hat trademarks that are incorporated in the
Packit 6f3914
  source code or documentation are not subject to the GNU General Public
Packit 6f3914
  License and may only be used or replicated with the express permission of
Packit 6f3914
  Red Hat, Inc.
Packit 6f3914
Packit 6f3914
=============================================
Packit 6f3914
 Comps, or the Distribution Compose Metadata
Packit 6f3914
=============================================
Packit 6f3914
Packit 6f3914
.. module:: dnf.comps
Packit 6f3914
Packit 6f3914
.. class:: Comps
Packit 6f3914
Packit 6f3914
  An object of this class can merge comps information from arbitrary repositories. It typically is instantiated from :class:`dnf.Base` and covers all the available repositories.
Packit 6f3914
Packit 6f3914
  The ``*_by_pattern`` methods all take a `pattern` and an optional `case_sensitive` parameter. The pattern is matched against names and IDs of objects in the domain (groups, categories, environments), the globbing characters in `pattern` retain their usual expanding meaning. If `case_sensitive` is ``True``, matching is done in a case-sensitive manner.
Packit 6f3914
Packit 6f3914
  .. attribute:: categories
Packit 6f3914
Packit 6f3914
    List of all contained :class:`dnf.comps.Category` objects.
Packit 6f3914
Packit 6f3914
  .. attribute:: environments
Packit 6f3914
Packit 6f3914
    List of all contained :class:`dnf.comps.Environment` objects ordered by `display_order` tag defined in comps.xml file.
Packit 6f3914
Packit 6f3914
  .. attribute:: groups
Packit 6f3914
Packit 6f3914
    List of all contained :class:`dnf.comps.Group` objects ordered by `display_order` tag defined in comps.xml file.
Packit 6f3914
Packit 6f3914
  .. method:: category_by_pattern(pattern, case_sensitive=False)
Packit 6f3914
Packit 6f3914
    Returns a :class:`dnf.comps.Category` object matching `pattern`, or ``None``.
Packit 6f3914
Packit 6f3914
  .. method:: categories_by_pattern(pattern, case_sensitive=False)
Packit 6f3914
Packit 6f3914
    Return an iterable of :class:`dnf.comps.Category` objects matching `pattern`.
Packit 6f3914
Packit 6f3914
  .. method:: categories_iter
Packit 6f3914
Packit 6f3914
    Return iterator over all contained :class:`dnf.comps.Category` objects.
Packit 6f3914
Packit 6f3914
  .. method:: environment_by_pattern(pattern, case_sensitive=False)
Packit 6f3914
Packit 6f3914
    Return a :class:`dnf.comps.Environment` object matching `pattern`, or ``None``.
Packit 6f3914
Packit 6f3914
  .. method:: environments_by_pattern(pattern, case_sensitive=False)
Packit 6f3914
Packit 6f3914
    Return an iterable of :class:`dnf.comps.Environment` objects matching `pattern` ordered by `display_order` tag defined in comps.xml file.
Packit 6f3914
Packit 6f3914
  .. attribute:: environments_iter
Packit 6f3914
Packit 6f3914
    Return iterator over all contained :class:`dnf.comps.Environment` objects in order they appear in comps.xml file.
Packit 6f3914
Packit 6f3914
  .. method:: group_by_pattern(pattern, case_sensitive=False)
Packit 6f3914
Packit 6f3914
    Return a :class:`dnf.comps.Group` object matching `pattern`, or ``None``.
Packit 6f3914
Packit 6f3914
  .. method:: groups_by_pattern(pattern, case_sensitive=False)
Packit 6f3914
Packit 6f3914
    Return an iterable of :class:`dnf.comps.Group` objects matching `pattern` ordered by `display_order` tag defined in comps.xml file.
Packit 6f3914
Packit 6f3914
  .. attribute:: groups_iter
Packit 6f3914
Packit 6f3914
    Return iterator over all contained :class:`dnf.comps.Group` objects in order they appear in comps.xml file.
Packit 6f3914
Packit 6f3914
.. class:: Package
Packit 6f3914
Packit 6f3914
  Represents comps package data.
Packit 6f3914
Packit 6f3914
  .. NOTE::
Packit 6f3914
Packit 6f3914
    Should not be confused with :class:`dnf.package.Package` which represents a package contained in a :class:`~.Sack`. There is no guarantee whether the comps package has a corresponding real sack package, i.e. there can be no package of given name in the sack, one such package, or more than one. For this reason two separate types are introduced.
Packit 6f3914
Packit 6f3914
  .. attribute:: name
Packit 6f3914
Packit 6f3914
    Name of the package.
Packit 6f3914
Packit 6f3914
  .. attribute:: option_type
Packit 6f3914
Packit 6f3914
    The type of inclusion of this particular package in its group. Must be one of the :data:`inclusion types <dnf.comps.CONDITIONAL>`.
Packit 6f3914
Packit 6f3914
.. class:: Category
Packit 6f3914
Packit 6f3914
  .. attribute:: id
Packit 6f3914
Packit 6f3914
    Unique identifier of the category.
Packit 6f3914
Packit 6f3914
  .. attribute:: name
Packit 6f3914
Packit 6f3914
    Name of the category.
Packit 6f3914
Packit 6f3914
  .. attribute:: ui_name
Packit 6f3914
Packit 6f3914
    The name of the category translated to the language given by the current locale.
Packit 6f3914
Packit 6f3914
  .. attribute:: ui_description
Packit 6f3914
Packit 6f3914
    The description of the category translated to the language given by the current locale.
Packit 6f3914
Packit 6f3914
.. class:: Environment
Packit 6f3914
Packit 6f3914
  Has the same set of attributes as :class:`dnf.comps.Category`.
Packit 6f3914
Packit 6f3914
.. class:: Group
Packit 6f3914
Packit 6f3914
  Has the same set of attributes as :class:`dnf.comps.Category`.
Packit 6f3914
Packit 6f3914
  .. method:: packages_iter()
Packit 6f3914
Packit 6f3914
    Return iterator over all :class:`packages <.Package>` belonging in this group.
Packit 6f3914
Packit 6f3914
Following types of inclusions of objects in their parent objects are defined:
Packit 6f3914
Packit 6f3914
.. data:: CONDITIONAL
Packit 6f3914
Packit 6f3914
.. data:: DEFAULT
Packit 6f3914
Packit 6f3914
.. data:: MANDATORY
Packit 6f3914
Packit 6f3914
.. data:: OPTIONAL