0
  4   ˆl–Ðz¾””Ð?Je@µp-\jbÑ¿ŽþJ5›”�<QB6Ð?ŸÆ234ÅÄÃ  ê    Metadata-Version: 2.1
Name: python-apt
Version: 2.6.0
Summary: Python bindings for APT
Author: APT Development Team
Author-email: deity@lists.debian.org
License: GNU GPL
Platform: posix
License-File: COPYING.GPL
License-File: AUTHORS
  C   ˆl–ß=¿Jå/”Š�ÆZ¸ÓjbÑ¿�þZpM,ÙejWèä• ?Ç„¯¶çÆ_ŠI|¥�+Wé3ž¯ÆÅ ?÷     #!/usr/bin/env python

"""
Query Debian's Bug Tracking System (BTS).

This module provides a layer between Python and Debian's BTS. It provides
methods to query the BTS using the BTS' SOAP interface, and the Bugreport class
which represents a bugreport from the BTS.
"""


from __future__ import annotations

import base64
import email.feedparser
import email.policy
from datetime import datetime
import os
import logging
from typing import Any, Iterable

from pysimplesoap.client import SoapClient
from pysimplesoap.simplexml import SimpleXMLElement


logger = logging.getLogger(__name__)


# Support running from Debian infrastructure
ca_path = "/etc/ssl/ca-debian"
if os.path.isdir(ca_path):
    os.environ["SSL_CERT_DIR"] = ca_path


# Setup the soap server
# Default values
URL = "https://bugs.debian.org/cgi-bin/soap.cgi"
NS = "Debbugs/SOAP/V1"
BTS_URL = "https://bugs.debian.org/"
# Max number of bugs to send in a single get_status request
BATCH_SIZE = 500

SEVERITIES = {
    "critical": 7,
    "grave": 6,
    "serious": 5,
    "important": 4,
    "normal": 3,
    "minor": 2,
    "wishlist": 1,
}


class Bugreport:
    """Represents a bugreport from Debian's Bug Tracking System.

    A bugreport object provides all attributes provided by the SOAP interface.
    Most of the attributes are strings, the others are marked.

    Attributes
    ----------
    bug_num : int
        The bugnumber
    severity : str
        Severity of the bugreport
    tags : list[str]
        Tags of the bugreport
    subject : str
        The subject/title of the bugreport
    originator : str
        Submitter of the bugreport
    mergedwith : list[int]
        List of bugnumbers this bug was merged with
    package : str
        Package of the bugreport
    source : str
        Source package of the bugreport
    date : datetime
        Date of bug creation
    log_modified : datetime
        Date of update of the bugreport
    done : boolean
        Is the bug fixed or not
    done_by : str | None
        Name and Email or None
    archived : bool
        Is the bug archived or not
    unarchived : bool
        Was the bug unarchived or not
    fixed_versions : list[str]
        List of versions, can be empty even if bug is fixed
    found_versions : list[str]
        List of version numbers where bug was found
    forwarded : str
        A URL or email address
    blocks: list[int]
        List of bugnumbers this bug blocks
    blockedby : list[int]
        List of bugnumbers which block this bug
    pending : str
        Either 'pending' or 'done'
    msgid : str
        Message ID of the bugreport
    owner : str
        Who took responsibility for fixing this bug
    location : str
        Either 'db-h' or 'archive'
    affects : list[str]
        List of Packagenames
    summary : str
        Arbitrary text
    """

    def __init__(self) -> None:
        self.originator: str
        self.date: datetime
        self.subject: str
        self.msgid: str
        self.package: str
        self.tags: list[str]
        self.done: bool
        self.done_by: str | None
        self.forwarded: str
        self.mergedwith: list[int]
        self.severity: str
        self.owner: str
        self.found_versions: list[str]
        self.fixed_versions: list[str]
        self.blocks: list[int]
        self.blockedby: list[int]
        self.unarchived: bool
        self.summary: str
        self.affects: list[str]
        self.log_modified: datetime
        self.location: str
        self.archived: bool
        self.bug_num: int
        self.source: str
        self.pending: str
        # The ones below are also there but not used
        # self.fixed = None
        # sel