Commit a2d54aad authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Replace a list comprehension with a yield function

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <>
parent 98f55779
......@@ -36,10 +36,12 @@ if __name__ == '__main__':
globals_file = config_folder / 'ci-globals.yml'
def is_distribution_file(f):
return'.yml') and not'ci-')
def distribution_files():
for f in config_folder.iterdir():
if'.yml') and not'ci-'):
yield f
for distrib in [x for x in config_folder.iterdir() if is_distribution_file(x)]:
for distrib in distribution_files():
name =[:-4] # drop .yml
# generate the distribution's template file,
......@@ -92,7 +94,7 @@ if __name__ == '__main__':
s = '", "'.join(sorted(set(remote_images)))
new_config.write(f'remote_images: ["{s}"]\n'.encode('utf8'))
distributions = [[:-4] for d in config_folder.iterdir() if is_distribution_file(d)]
distributions = [[:-4] for d in distribution_files()]
s = '", "'.join(sorted(set(distributions)))
new_config.write(f'distribs: ["{s}"]\n'.encode('utf8'))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment