[appimage] refactoring: typing

This commit is contained in:
Vinicius Moreira
2022-10-24 07:48:41 -03:00
parent 695f5e03f0
commit 123983dfaa
2 changed files with 7 additions and 6 deletions

View File

@@ -528,13 +528,13 @@ class AppImageManager(SoftwareManager, SettingsController):
finally:
releases_con.close()
def _find_desktop_file(self, folder: str) -> str:
def _find_desktop_file(self, folder: str) -> Optional[str]:
for r, d, files in os.walk(folder):
for f in files:
if f.endswith('.desktop'):
return f
def _find_icon_file(self, folder: str) -> str:
def _find_icon_file(self, folder: str) -> Optional[str]:
for f in glob.glob(folder + ('/**' if not folder.endswith('/') else '**'), recursive=True):
if RE_ICON_ENDS_WITH.match(f):
return f