mirror of
https://github.com/lutris/lutris
synced 2024-11-02 10:19:50 +00:00
Simplify logic with any()
This commit is contained in:
parent
d23977a859
commit
657180ed09
1 changed files with 3 additions and 13 deletions
|
@ -29,10 +29,7 @@ def is_excluded_elf(filename):
|
|||
"uninstall"
|
||||
)
|
||||
_fn = filename.lower()
|
||||
for exclude in excluded:
|
||||
if exclude in _fn:
|
||||
return True
|
||||
return False
|
||||
return any(exclude in _fn for exclude in excluded)
|
||||
|
||||
|
||||
def find_linux_game_executable(path, make_executable=False):
|
||||
|
@ -84,11 +81,7 @@ def is_excluded_dir(path):
|
|||
"users",
|
||||
"GameSpy Arcade"
|
||||
)
|
||||
skip = False
|
||||
for dir_name in path.split("/"):
|
||||
if dir_name in excluded:
|
||||
skip = True
|
||||
return skip
|
||||
return any(dir_name in excluded for dir_name in path.split("/"))
|
||||
|
||||
|
||||
def is_excluded_exe(filename):
|
||||
|
@ -101,10 +94,7 @@ def is_excluded_exe(filename):
|
|||
"dosbox.exe",
|
||||
)
|
||||
_fn = filename.lower()
|
||||
for exclude in excluded:
|
||||
if exclude in _fn:
|
||||
return True
|
||||
return False
|
||||
return any(exclude in _fn for exclude in excluded)
|
||||
|
||||
|
||||
def find_windows_game_executable(path):
|
||||
|
|
Loading…
Reference in a new issue