Skip to content

Commit f2c5dca

Browse files
committed
Remove superfluous list creation in join calls
1 parent db6c113 commit f2c5dca

File tree

14 files changed

+20
-20
lines changed

14 files changed

+20
-20
lines changed

archinstall/default_profiles/custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
# def info(self) -> Optional[ProfileInfo]:
178178
# enabled_profiles = [p for p in self._current_selection if p.custom_enabled]
179179
# if enabled_profiles:
180-
# details = ', '.join([p.name for p in enabled_profiles])
180+
# details = ', '.join(p.name for p in enabled_profiles)
181181
# gfx_driver = self.gfx_driver
182182
# return ProfileInfo(self.name, details, gfx_driver)
183183
#

archinstall/lib/disk/device_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def _lvm_info(
373373

374374
# for whatever reason the output sometimes contains
375375
# "File descriptor X leaked leaked on vgs invocation
376-
data = '\n'.join([raw for raw in raw_info if 'File descriptor' not in raw])
376+
data = '\n'.join(raw for raw in raw_info if 'File descriptor' not in raw)
377377

378378
debug(f'LVM info: {data}')
379379

@@ -489,7 +489,7 @@ def lvm_vol_reduce(self, vol_path: Path, amount: Size) -> None:
489489
SysCommand(cmd)
490490

491491
def lvm_pv_create(self, pvs: Iterable[Path]) -> None:
492-
pvs_str = ' '.join([str(pv) for pv in pvs])
492+
pvs_str = ' '.join(str(pv) for pv in pvs)
493493
# Signatures are already wiped by wipefs, -f is just for safety
494494
cmd = f'pvcreate -f --yes {pvs_str}'
495495
# note flags used in scripting
@@ -500,7 +500,7 @@ def lvm_pv_create(self, pvs: Iterable[Path]) -> None:
500500
self.udev_sync()
501501

502502
def lvm_vg_create(self, pvs: Iterable[Path], vg_name: str) -> None:
503-
pvs_str = ' '.join([str(pv) for pv in pvs])
503+
pvs_str = ' '.join(str(pv) for pv in pvs)
504504
cmd = f'vgcreate --yes --force {vg_name} {pvs_str}'
505505

506506
debug(f'Creating LVM group: {cmd}')

archinstall/lib/global_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ def _prev_mirror_config(self, item: MenuItem) -> str | None:
582582
if mirror_config.optional_repositories:
583583
title = tr('Optional repositories')
584584
divider = '-' * len(title)
585-
repos = ', '.join([r.value for r in mirror_config.optional_repositories])
585+
repos = ', '.join(r.value for r in mirror_config.optional_repositories)
586586
output += f'{title}\n{divider}\n{repos}\n\n'
587587

588588
if mirror_config.custom_repositories:

archinstall/lib/installer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ def _add_limine_bootloader(
15491549
f'cmdline: {kernel_params}',
15501550
]
15511551
config_contents += f'\n/Arch Linux ({kernel})\n'
1552-
config_contents += '\n'.join([f' {it}' for it in entry]) + '\n'
1552+
config_contents += '\n'.join(f' {it}' for it in entry) + '\n'
15531553
else:
15541554
entry = [
15551555
'protocol: linux',
@@ -1558,7 +1558,7 @@ def _add_limine_bootloader(
15581558
f'module_path: {path_root}:/initramfs-{kernel}.img',
15591559
]
15601560
config_contents += f'\n/Arch Linux ({kernel})\n'
1561-
config_contents += '\n'.join([f' {it}' for it in entry]) + '\n'
1561+
config_contents += '\n'.join(f' {it}' for it in entry) + '\n'
15621562

15631563
config_path.write_text(config_contents)
15641564

archinstall/lib/interactions/disk_conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def suggest_multi_disk_layout(
483483
if filesystem_type == FilesystemType.Btrfs:
484484
mount_options = select_mount_options()
485485

486-
device_paths = ', '.join([str(d.device_info.path) for d in devices])
486+
device_paths = ', '.join(str(d.device_info.path) for d in devices)
487487

488488
debug(f'Suggesting multi-disk-layout for devices: {device_paths}')
489489
debug(f'/root: {root_device.device_info.path}')

archinstall/lib/interactions/general_conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def ask_additional_packages_to_install(
149149
) -> list[str]:
150150
repositories |= {Repository.Core, Repository.Extra}
151151

152-
respos_text = ', '.join([r.value for r in repositories])
152+
respos_text = ', '.join(r.value for r in repositories)
153153
output = tr('Repositories: {}').format(respos_text) + '\n'
154154

155155
output += tr('Loading packages...')

archinstall/lib/mirrors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def _prev_regions(self, item: MenuItem) -> str:
275275
def _prev_additional_repos(self, item: MenuItem) -> str | None:
276276
if item.value:
277277
repositories: list[Repository] = item.value
278-
repos = ', '.join([repo.value for repo in repositories])
278+
repos = ', '.join(repo.value for repo in repositories)
279279
return f'{tr("Additional repositories")}: {repos}'
280280
return None
281281

@@ -292,7 +292,7 @@ def _prev_custom_servers(self, item: MenuItem) -> str | None:
292292
return None
293293

294294
custom_servers: list[CustomServer] = item.value
295-
output = '\n'.join([server.url for server in custom_servers])
295+
output = '\n'.join(server.url for server in custom_servers)
296296
return output.strip()
297297

298298
@override

archinstall/lib/models/device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def table_data(self) -> dict[str, str]:
522522
'Start': self.start.format_size(Unit.sectors, self.sector_size, include_unit=False),
523523
'End': end.format_size(Unit.sectors, self.sector_size, include_unit=False),
524524
'Size': self.length.format_highest(),
525-
'Flags': ', '.join([f.description for f in self.flags]),
525+
'Flags': ', '.join(f.description for f in self.flags),
526526
}
527527

528528
if self.btrfs_subvol_infos:
@@ -1044,7 +1044,7 @@ def table_data(self) -> dict[str, str]:
10441044
'FS type': self.fs_type.value if self.fs_type else 'Unknown',
10451045
'Mountpoint': str(self.mountpoint) if self.mountpoint else '',
10461046
'Mount options': ', '.join(self.mount_options),
1047-
'Flags': ', '.join([f.description for f in self.flags]),
1047+
'Flags': ', '.join(f.description for f in self.flags),
10481048
}
10491049

10501050
if self.btrfs_subvols:

archinstall/lib/models/mirrors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,11 @@ class MirrorConfiguration:
243243

244244
@property
245245
def region_names(self) -> str:
246-
return '\n'.join([m.name for m in self.mirror_regions])
246+
return '\n'.join(m.name for m in self.mirror_regions)
247247

248248
@property
249249
def custom_server_urls(self) -> str:
250-
return '\n'.join([s.url for s in self.custom_servers])
250+
return '\n'.join(s.url for s in self.custom_servers)
251251

252252
def json(self) -> _MirrorConfigurationSerialization:
253253
regions = {}

archinstall/lib/models/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def as_systemd_config(self) -> str:
9898
config_str = ''
9999
for top, entries in config.items():
100100
config_str += f'[{top}]\n'
101-
config_str += '\n'.join([f'{k}={v}' for k, v in entries])
101+
config_str += '\n'.join(f'{k}={v}' for k, v in entries)
102102
config_str += '\n\n'
103103

104104
return config_str

0 commit comments

Comments
 (0)