From 4c02335412e33f43de8c11a780abfdcb43bc6167 Mon Sep 17 00:00:00 2001 From: boyska Date: Fri, 10 May 2024 13:37:22 +0200 Subject: [PATCH] change: weights are divided among children --- feed | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feed b/feed index d09b46e..c7f707b 100755 --- a/feed +++ b/feed @@ -603,7 +603,7 @@ def expand_glob(sources: list, weights: list) -> tuple: ''' Let's say that sources=["foo", "bar*"] and weight=["2", "3"] and on filesystem there are bar1 and bar2. - Result: ["foo", "bar1", "bar2"], ["2", "3", "3"] + Result: ["foo", "bar1", "bar2"], ["2", "1.5", "1.5"] ''' new_sources = [] new_weights = [] @@ -614,7 +614,7 @@ def expand_glob(sources: list, weights: list) -> tuple: else: expanded_source = [src] logging.debug("glob: %s -> %s", src, expanded_source) - expanded_weight = [weight] * len(expanded_source) + expanded_weight = [weight / len(expanded_source)] * len(expanded_source) new_sources += expanded_source new_weights += expanded_weight