[displaymanager] Simplify DE class
- The DE isn't being configured, and isn't where the complexity lies. Drop the ABC from it.
This commit is contained in:
parent
76a7c439c1
commit
f188c6f71b
@ -30,13 +30,16 @@ import libcalamares
|
|||||||
import configparser
|
import configparser
|
||||||
|
|
||||||
|
|
||||||
class DesktopEnvironment(metaclass=abc.ABCMeta):
|
class DesktopEnvironment:
|
||||||
"""
|
"""
|
||||||
Desktop Environment base class. A subclass
|
Desktop Environment -- some utility functions for a desktop
|
||||||
implements DE maintainence for a specific DE.
|
environment (e.g. finding out if it is installed). This
|
||||||
|
is independent of the *Display Manager*, which is what
|
||||||
|
we're configuring in this module.
|
||||||
"""
|
"""
|
||||||
executable = None
|
def __init__(self, exec, desktop):
|
||||||
desktop_file = None
|
self.executable = exec
|
||||||
|
self.desktop_file = desktop
|
||||||
|
|
||||||
def find_desktop_environment(self, root_mount_point):
|
def find_desktop_environment(self, root_mount_point):
|
||||||
"""
|
"""
|
||||||
@ -48,16 +51,6 @@ class DesktopEnvironment(metaclass=abc.ABCMeta):
|
|||||||
os.path.exists("{!s}/usr/share/xsessions/{!s}.desktop".format(root_mount_point, self.desktop_file))
|
os.path.exists("{!s}/usr/share/xsessions/{!s}.desktop".format(root_mount_point, self.desktop_file))
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, exec, desktop):
|
|
||||||
self.executable = exec
|
|
||||||
self.desktop_file = desktop
|
|
||||||
|
|
||||||
# Collect all the subclasses of DesktopEnvironment defined above,
|
|
||||||
desktop_environments = [
|
|
||||||
c for c in globals().values()
|
|
||||||
if type(c) is abc.ABCMeta and issubclass(c, DesktopEnvironment) and c.desktop_file
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
desktop_environments = [
|
desktop_environments = [
|
||||||
DesktopEnvironment('/usr/bin/startkde', 'plasma'), # KDE Plasma 5
|
DesktopEnvironment('/usr/bin/startkde', 'plasma'), # KDE Plasma 5
|
||||||
|
Loading…
Reference in New Issue
Block a user