0x1949 Team - FAZEMRX - MANAGER
Edit File: changelog.cpython-310.pyc
o ���aЗ � @ sX d Z ddlZddlZddlZddlZddlZzddlZW n ey% Y nw z-ddl m Z mZmZm Z mZmZmZmZmZmZmZmZ eeeee ee ee f ZW n ey\ Y nw ddlmZ G dd� de�ZG dd� de�ZG d d � d e�ZG dd� de�Ze� d ddi ej!�Z"e� d�Z#e� d�Z$e� d�Z%e� d�Z&e� d�Z'e� dej!�Z(e� dej!�Z)e� dej!�Z*e� dej!�Z+e� dej!�Z,e� d�Z-e� d�Z.e� d�Z/e� dej!�Z0e� dej!�Z1e� d�Z2e� d �Z3e� d!ej!�Z4e� d"ej!�Z5e� d#ej!�Z6e� d$ej!�Z7e� d%ej!�Z8e� d&�Z9G d'd(� d(e�Z:d)d*� Z;d.d,d-�Z<dS )/a� Facilities for reading and writing Debian changelogs The aim of this module is to provide programmatic access to Debian changelogs to query and manipulate them. The format for the changelog is defined in `deb-changelog(5) <https://manpages.debian.org/stretch/dpkg-dev/deb-changelog.5.html>`_ Stability: The API is not marked as stable but hasn't changed incompatibly since 2007. Potential users of these classes are asked to work with the `python-debian` maintainers to improve, extend and stabilise this API. Overview ======== Create a changelog object using the constuctor. Pass it the contents of the file if there are some entries, or ``None`` to create an empty changelog:: >>> import debian.changelog >>> ch = debian.changelog.Changelog() >>> maintainer, email = 'John Doe', 'joe@example.com' >>> timestamp = 1617222715 >>> # You might want to use get_maintainer() a la: >>> # maintainer, email = debian.changelog.get_maintainer() >>> ch.new_block( ... package='example', ... version='0.1', ... distributions='unstable', ... urgency='low', ... author="%s <%s>" % (maintainer, email), ... # You can also omit timestamp, if you are fine with "now" ... # We use a hard-coded timestamp for deterministic output ... date=debian.changelog.format_date(timestamp=1617222715, localtime=False) ... ) >>> ch.add_change('') >>> ch.add_change(' * Some change') >>> ch.add_change('') >>> print(ch, end='') example (0.1) unstable; urgency=low <BLANKLINE> * Some change <BLANKLINE> -- John Doe <joe@example.com> Wed, 31 Mar 2021 20:31:55 -0000 <BLANKLINE> If you have the full contents of a changelog, but are only interested in the most recent versions you can pass the ``max_blocks`` keyword parameter to the constuctor to limit the number of blocks of the changelog that will be parsed. If you are only interested in the most recent version of the package then pass ``max_blocks=1``:: >>> import gzip >>> from debian.changelog import Changelog >>> with gzip.open('/usr/share/doc/dpkg/changelog.Debian.gz') as fh: ... ch = Changelog(fh, max_blocks=1) >>> print(''' ... Package: %s ... Version: %s ... Urgency: %s''' % (ch.package, ch.version, ch.urgency)) # doctest: +SKIP Package: dpkg Version: 1.18.24 Urgency: medium See `/usr/share/doc/python-debian/examples/changelog/` or the `git repository <https://salsa.debian.org/python-debian-team/python-debian/tree/master/ examples/changelog>`_ for examples of usage. The :class:`Changelog` class is the key class within this module. Changelog Classes ----------------- � N)�Any�Dict�Iterable�Iterator�IO�List�Optional�Pattern�Union�Text�Tuple�TypeVar)�Versionc �, e Zd ZdZdZ� fdd�Zdd� Z� ZS )�ChangelogParseErrorz0Indicates that the changelog could not be parsedTc � || _ tt| ��� d S �N)�_line�superr �__init__��self�line�� __class__� �2/usr/lib/python3/dist-packages/debian/changelog.pyr � � zChangelogParseError.__init__c C � d| j S )NzCould not parse changelog: )r �r r r r �__str__� � zChangelogParseError.__str__��__name__� __module__�__qualname__�__doc__� is_user_errorr r � __classcell__r r r r r � s r c @ s e Zd ZdZdS )�ChangelogCreateErrorz`Indicates that changelog could not be created, as all the information required was not givenN)r# r$ r% r&