From d2ba14dcedb875f6c1680cae50ae94041dcd2f3c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jun 19 2023 12:29:14 +0000 Subject: Make latest black happy with src/ It likes "for i in foo, bar" not "for i in (foo, bar)", it seems. OK. Signed-off-by: Adam Williamson --- diff --git a/src/fedfind/helpers.py b/src/fedfind/helpers.py index 63ee61a..bb363d1 100644 --- a/src/fedfind/helpers.py +++ b/src/fedfind/helpers.py @@ -550,7 +550,7 @@ def parse_cid(origcid, dist=False, dic=False): # *not* allowed to contain digits. Let's see if we can spot what # looks like a '-mainver'- component... elems = part.split("-") - for (idx, cand) in enumerate(elems): + for idx, cand in enumerate(elems): # can't be the first or the last if idx == 0 or idx == len(elems) - 1: continue @@ -688,10 +688,10 @@ def get_weight(imgdict, arch=True): ) imgscore = 0 if arch: - for (values, score) in archscores: + for values, score in archscores: if imgdict["arch"] in values: imgscore += score - for (values, score) in loadscores: + for values, score in loadscores: if imgdict["subvariant"].lower() in values: imgscore += score return imgscore diff --git a/src/fedfind/release.py b/src/fedfind/release.py index 65365d0..f632494 100644 --- a/src/fedfind/release.py +++ b/src/fedfind/release.py @@ -58,6 +58,7 @@ import fedfind.helpers # pylint:disable=invalid-name logger = logging.getLogger(__name__) + # HELPER FUNCTIONS FOR get_release def _val_in_str(values, strings): """True if any value contains any of the strings in the 'strings' @@ -1921,7 +1922,7 @@ class MirrorRelease(Release): variants = {} # look, this is just complicated, okay? jeez. # pylint:disable=too-many-nested-blocks - for (loc, path, size) in paths: + for loc, path, size in paths: matches = 0 matched = None # We only try to find *unique* filenames in the existing @@ -2073,7 +2074,7 @@ class MirrorRelease(Release): else: relname = self.release exp = re.compile(r"-{}-(\d+\.\d+)\.".format(relname)) - for (_, path) in self.all_paths: + for _, path in self.all_paths: fname = path.split("/")[-1] match = exp.search(fname) if match: