[displaymanager] Non-existent DMs don't exist

- Returning True for a non-existent DM is weird
 - Avoid suggestive parenthesis in return type
main
Adriaan de Groot 6 years ago
parent b66f3434af
commit 333a1f6e84

@ -8,7 +8,7 @@
# Copyright 2014, Kevin Kofler <kevin.kofler@chello.at> # Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
# Copyright 2017, Alf Gaida <agaida@siduction.org> # Copyright 2017, Alf Gaida <agaida@siduction.org>
# Copyright 2017, Bernhard Landauer <oberon@manjaro.org> # Copyright 2017, Bernhard Landauer <oberon@manjaro.org>
# Copyright 2017, Adriaan de Groot <groot@kde.org> # Copyright 2017, 2019, Adriaan de Groot <groot@kde.org>
# Copyright 2019, Dominic Hayes <ferenosdev@outlook.com> # Copyright 2019, Dominic Hayes <ferenosdev@outlook.com>
# #
# Calamares is free software: you can redistribute it and/or modify # Calamares is free software: you can redistribute it and/or modify
@ -117,14 +117,11 @@ class DisplayManager(metaclass=abc.ABCMeta):
in the target system. in the target system.
""" """
if self.executable is None: if self.executable is None:
return True return False
bin_path = "{!s}/usr/bin/{!s}".format(self.root_mount_point, self.executable) bin_path = "{!s}/usr/bin/{!s}".format(self.root_mount_point, self.executable)
sbin_path = "{!s}/usr/sbin/{!s}".format(self.root_mount_point, self.executable) sbin_path = "{!s}/usr/sbin/{!s}".format(self.root_mount_point, self.executable)
return ( return os.path.exists(bin_path) or os.path.exists(sbin_path)
os.path.exists(bin_path)
or os.path.exists(sbin_path)
)
# The four abstract methods below are called in the order listed here. # The four abstract methods below are called in the order listed here.
# They must all be implemented by subclasses, but not all of them # They must all be implemented by subclasses, but not all of them

Loading…
Cancel
Save