change: weights are divided among children
This commit is contained in:
parent
4c9f73f705
commit
4c02335412
1 changed files with 2 additions and 2 deletions
4
feed
4
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.
|
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_sources = []
|
||||||
new_weights = []
|
new_weights = []
|
||||||
|
@ -614,7 +614,7 @@ def expand_glob(sources: list, weights: list) -> tuple:
|
||||||
else:
|
else:
|
||||||
expanded_source = [src]
|
expanded_source = [src]
|
||||||
logging.debug("glob: %s -> %s", src, expanded_source)
|
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_sources += expanded_source
|
||||||
new_weights += expanded_weight
|
new_weights += expanded_weight
|
||||||
|
|
Loading…
Reference in a new issue