Converted genexps to setcomps
This commit is contained in:
@@ -241,11 +241,11 @@ class GogIterable(StoreSubSource):
|
|||||||
|
|
||||||
def get_installed_app_names(self):
|
def get_installed_app_names(self):
|
||||||
try:
|
try:
|
||||||
return (
|
return {
|
||||||
app_name
|
app_name
|
||||||
for entry in path_json_load(self.installed_path)["installed"]
|
for entry in path_json_load(self.installed_path)["installed"]
|
||||||
if (app_name := entry.get("appName")) is not None
|
if (app_name := entry.get("appName")) is not None
|
||||||
)
|
}
|
||||||
except (OSError, JSONDecodeError, KeyError, AttributeError) as error:
|
except (OSError, JSONDecodeError, KeyError, AttributeError) as error:
|
||||||
raise InvalidInstalledFileError(
|
raise InvalidInstalledFileError(
|
||||||
f"Invalid {self.installed_path.name}"
|
f"Invalid {self.installed_path.name}"
|
||||||
@@ -261,11 +261,11 @@ class NileIterable(StoreSubSource):
|
|||||||
def get_installed_app_names(self):
|
def get_installed_app_names(self):
|
||||||
try:
|
try:
|
||||||
installed_json = path_json_load(self.installed_path)
|
installed_json = path_json_load(self.installed_path)
|
||||||
return (
|
return {
|
||||||
app_name
|
app_name
|
||||||
for entry in installed_json
|
for entry in installed_json
|
||||||
if (app_name := entry.get("id")) is not None
|
if (app_name := entry.get("id")) is not None
|
||||||
)
|
}
|
||||||
except (OSError, JSONDecodeError, AttributeError) as error:
|
except (OSError, JSONDecodeError, AttributeError) as error:
|
||||||
raise InvalidInstalledFileError(
|
raise InvalidInstalledFileError(
|
||||||
f"Invalid {self.installed_path.name}"
|
f"Invalid {self.installed_path.name}"
|
||||||
|
|||||||
Reference in New Issue
Block a user