コード例 #1
0
    def get_snapcraft_yaml_name(self, owner, repo):
        """
        Return True if the name inside the yaml file match with the snap
        """
        loc = self.get_snapcraft_yaml_location(owner, repo)

        if loc:
            # Get last commit to avoid cache issues with raw.github.com
            last_commit = self.get_last_commit(owner, repo)

            response = self.session.request(
                "GET",
                f"{self.RAW_CONTENT_URL}/{owner}/{repo}/{last_commit}/{loc}",
            )

            yaml = get_yaml_loader()
            content = yaml.load(response.content)

            return content.get("name")

        return False
コード例 #2
0
import sys
import datetime
from collections import OrderedDict

import humanize
from dateutil import parser
from canonicalwebteam.docstring_extractor import get_docstrings
from webapp.helpers import decrease_headers
from webapp.helpers import (
    discourse_api,
    get_yaml_loader,
    md_parser,
)

yaml = get_yaml_loader()
UBUNTU_SERIES = {
    "warty": "4.10",
    "hoary": "5.04",
    "breezy": "5.10",
    "dapper": "6.06 LTS",
    "edgy": "6.10",
    "feisty": "7.04",
    "gutsy": "7.10",
    "hardy": "8.04 LTS",
    "intrepid": "8.10",
    "jaunty": "9.04",
    "karmic": "9.10",
    "lucid": "10.04 LTS",
    "maverick": "10.10",
    "natty": "11.04",
    "oneiric": "11.10",