diff --git a/distgit_bugzilla_sync/package_summary.py b/distgit_bugzilla_sync/package_summaries.py similarity index 97% rename from distgit_bugzilla_sync/package_summary.py rename to distgit_bugzilla_sync/package_summaries.py index d900559..6c03ed7 100644 --- a/distgit_bugzilla_sync/package_summary.py +++ b/distgit_bugzilla_sync/package_summaries.py @@ -69,7 +69,7 @@ def decompress_db(name, archive, location): def needs_update(local_file, remote_sha, sha_type): - ''' Compare sha of a local and remote file. + ''' Compare hash of a local and remote file. Return True if our local file needs to be updated. ''' @@ -78,7 +78,7 @@ def needs_update(local_file, remote_sha, sha_type): # "changed" return True - # Old old epel5 doesn't even know which sha it is using.. + # Old epel5 doesn't even know which sha it is using... if sha_type == 'sha': sha_type = 'sha1' @@ -181,7 +181,7 @@ def get_primary_xml(destfolder, url, name): return destfile -def get_package_summary(): +def get_package_summaries(): start = time.time() primary_xml = get_primary_xml( @@ -201,7 +201,7 @@ def get_package_summary(): if __name__ == "__main__": logging.basicConfig(level=logging.DEBUG) - db = get_package_summary() + db = get_package_summaries() print(f"guake: {db.get('guake')}") print(f"geany: {db.get('geany')}") print(f"kernel: {db.get('kernel')}") diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index f2b39b9..145ddd9 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -52,7 +52,7 @@ from requests.adapters import HTTPAdapter from urllib3.util import Retry import yaml -from . import package_summary +from . import package_summaries from .config import config, email_overrides, load_configuration @@ -598,16 +598,16 @@ class DistgitBugzillaSync: watchers=pagure_namespace_to_cc[namespace][name], )) - def add_branches_product_and_summary(self): - """ For each project retrieved this method adds branches, products + def add_branches_products_and_summaries(self): + """ For each project retrieved, this method adds branches, products and summary information. - The branches are retrieved from PDC + The branches are retrieved from PDC. The products are determined based on the branches. - The summary is coming from the primary.xml file from the repodata - of the rawhide repository in koji. + The summaries are coming from the primary.xml file of the Rawhide repodata + in Koji. """ branches_url = "/".join([ self.env['pdc_url'].split('rest_api')[0].rstrip("/"), @@ -621,7 +621,7 @@ class DistgitBugzillaSync: # Summary summary = None if project["namespace"] == "rpms": - summary = self.rpm_summary.get(project["name"]) + summary = self.rpm_summaries.get(project["name"]) project["summary"] = summary # Branches @@ -735,11 +735,11 @@ class DistgitBugzillaSync: self.session = retry_session() if self.env["verbose"]: - print("Building a cache of the rpm packages' summary") - self.rpm_summary = package_summary.get_package_summary() + print("Building a cache of the rpm package summaries") + self.rpm_summaries = package_summaries.get_package_summaries() self.get_pagure_projects(self.args.projects) - self.add_branches_product_and_summary() + self.add_branches_products_and_summaries() if self.env["verbose"]: print(f"{len(self.pagure_projects)} projects to consider")