mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 17:45:55 +02:00
jw.pkg.cmds: Replace split('\n') by splitlines()
splitlines() removes empty lines, so use it and save some lines of code. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
c8036ad216
commit
595995e084
2 changed files with 2 additions and 6 deletions
|
|
@ -26,9 +26,7 @@ async def all_installed_packages() -> Iterable[Package]:
|
|||
tag_str = '|'.join([f'%{{{tag}}}' for tag in query_tags]) + r'\n'
|
||||
opts.append(tag_str)
|
||||
package_list_str, stderr = await run_rpm('-qa', *opts, sudo=False)
|
||||
for package_str in package_list_str.split('\n'):
|
||||
if not package_str:
|
||||
continue
|
||||
for package_str in package_list_str.splitlines():
|
||||
tags = package_str.split('|')
|
||||
ret.append(Package(name=tags[0], vendor=tags[1], packager=tags[2], url=tags[3]))
|
||||
return ret
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue