[servicescfg] PEP8 modification
This commit is contained in:
parent
4b19c677b3
commit
cf1c4bd7ae
@ -4,6 +4,7 @@
|
||||
# === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
#
|
||||
# Copyright 2016, Artoo <artoo@manjaro.org>
|
||||
# Copyright 2017, Philip Müller <philm@manjaro.org>
|
||||
#
|
||||
# Calamares is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -23,6 +24,7 @@ import libcalamares
|
||||
from libcalamares.utils import target_env_call
|
||||
from os.path import exists, join
|
||||
|
||||
|
||||
class ServicesController:
|
||||
def __init__(self):
|
||||
self.__root = libcalamares.globalstorage.value('rootMountPoint')
|
||||
@ -40,19 +42,39 @@ class ServicesController:
|
||||
target_env_call(["sed", "-e", pattern, "-i", file])
|
||||
|
||||
def configure(self):
|
||||
self.setExpression('s|^.*rc_shell=.*|rc_shell="/usr/bin/sulogin"|', "/etc/rc.conf")
|
||||
self.setExpression('s|^.*rc_controller_cgroups=.*|rc_controller_cgroups="YES"|', "/etc/rc.conf")
|
||||
exp = 's|^.*keymap=.*|keymap="' + libcalamares.globalstorage.value("keyboardLayout") + '"|'
|
||||
self.setExpression(
|
||||
's|^.*rc_shell=.*|rc_shell="/usr/bin/sulogin"|',
|
||||
"/etc/rc.conf"
|
||||
)
|
||||
self.setExpression(
|
||||
's|^.*rc_controller_cgroups=.*|rc_controller_cgroups="YES"|',
|
||||
"/etc/rc.conf"
|
||||
)
|
||||
exp = 's|^.*keymap=.*|keymap="' \
|
||||
+ libcalamares.globalstorage.value("keyboardLayout") \
|
||||
+ '"|'
|
||||
self.setExpression(exp, "/etc/conf.d/keymaps")
|
||||
self.setExpression('s|pam_systemd.so|pam_ck_connector.so nox11|', "/etc/pam.d/system-login")
|
||||
self.setExpression(
|
||||
's|pam_systemd.so|pam_ck_connector.so nox11|',
|
||||
"/etc/pam.d/system-login"
|
||||
)
|
||||
for dm in libcalamares.globalstorage.value("displayManagers"):
|
||||
exp = 's|^.*DISPLAYMANAGER=.*|DISPLAYMANAGER="' + dm + '"|'
|
||||
self.setExpression(exp, "/etc/conf.d/xdm")
|
||||
if dm == "lightdm":
|
||||
self.setExpression('s|^.*minimum-vt=.*|minimum-vt=7|', "/etc/lightdm/lightdm.conf")
|
||||
self.setExpression('s|pam_systemd.so|pam_ck_connector.so nox11|', "/etc/pam.d/lightdm-greeter")
|
||||
self.setExpression(
|
||||
's|^.*minimum-vt=.*|minimum-vt=7|',
|
||||
"/etc/lightdm/lightdm.conf"
|
||||
)
|
||||
self.setExpression(
|
||||
's|pam_systemd.so|pam_ck_connector.so nox11|',
|
||||
"/etc/pam.d/lightdm-greeter"
|
||||
)
|
||||
if exists(join(self.root, "etc/pulse/client.conf")):
|
||||
self.setExpression('s|autospawn = no|autospawn = yes|', "/etc/pulse/client.conf")
|
||||
self.setExpression(
|
||||
's|autospawn = no|autospawn = yes|',
|
||||
"/etc/pulse/client.conf"
|
||||
)
|
||||
|
||||
def update(self, action, state):
|
||||
for svc in self.services[state]:
|
||||
@ -69,6 +91,7 @@ class ServicesController:
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def run():
|
||||
""" Setup openrc services """
|
||||
sc = ServicesController()
|
||||
|
Loading…
Reference in New Issue
Block a user