[PEP 8] Comparison to 'None'
This commit is contained in:
parent
1b7b999449
commit
ebf037f247
@ -96,7 +96,7 @@ def set_autologin(username, displaymanagers, default_desktop_environment, root_m
|
|||||||
if os.path.exists("{!s}/var/lib/AccountsService/users".format(root_mount_point)):
|
if os.path.exists("{!s}/var/lib/AccountsService/users".format(root_mount_point)):
|
||||||
os.system(
|
os.system(
|
||||||
"echo \"[User]\" > {!s}/var/lib/AccountsService/users/{!s}".format(root_mount_point,username))
|
"echo \"[User]\" > {!s}/var/lib/AccountsService/users/{!s}".format(root_mount_point,username))
|
||||||
if default_desktop_environment != None:
|
if default_desktop_environment is not None:
|
||||||
os.system(
|
os.system(
|
||||||
"echo \"XSession={!s}\" >> {!s}/var/lib/AccountsService/users/{!s}".format(default_desktop_environment.desktop_file,root_mount_point,username))
|
"echo \"XSession={!s}\" >> {!s}/var/lib/AccountsService/users/{!s}".format(default_desktop_environment.desktop_file,root_mount_point,username))
|
||||||
os.system(
|
os.system(
|
||||||
@ -188,7 +188,7 @@ def set_autologin(username, displaymanagers, default_desktop_environment, root_m
|
|||||||
line = 'User={}\n'.format(username)
|
line = 'User={}\n'.format(username)
|
||||||
# Session= line, commented out or with empty value
|
# Session= line, commented out or with empty value
|
||||||
if re.match('\\s*#\\s*Session=|\\s*Session=$', line):
|
if re.match('\\s*#\\s*Session=|\\s*Session=$', line):
|
||||||
if default_desktop_environment != None:
|
if default_desktop_environment is not None:
|
||||||
line = 'Session={}.desktop\n'.format(default_desktop_environment.desktop_file)
|
line = 'Session={}.desktop\n'.format(default_desktop_environment.desktop_file)
|
||||||
sddm_conf.write(line)
|
sddm_conf.write(line)
|
||||||
|
|
||||||
@ -255,7 +255,7 @@ def run():
|
|||||||
['chown', '-R', 'lightdm:lightdm', '/run/lightdm'])
|
['chown', '-R', 'lightdm:lightdm', '/run/lightdm'])
|
||||||
libcalamares.utils.chroot_call(
|
libcalamares.utils.chroot_call(
|
||||||
['chmod', '+r' '/etc/lightdm/lightdm.conf'])
|
['chmod', '+r' '/etc/lightdm/lightdm.conf'])
|
||||||
if default_desktop_environment != None:
|
if default_desktop_environment is not None:
|
||||||
os.system(
|
os.system(
|
||||||
"sed -i -e \"s/^.*user-session=.*/user-session={!s}/\" {!s}/etc/lightdm/lightdm.conf".format(default_desktop_environment.desktop_file,root_mount_point))
|
"sed -i -e \"s/^.*user-session=.*/user-session={!s}/\" {!s}/etc/lightdm/lightdm.conf".format(default_desktop_environment.desktop_file,root_mount_point))
|
||||||
else:
|
else:
|
||||||
@ -293,7 +293,7 @@ def run():
|
|||||||
libcalamares.utils.chroot_call(
|
libcalamares.utils.chroot_call(
|
||||||
['chown', 'root:mdm', '/var/lib/mdm'])
|
['chown', 'root:mdm', '/var/lib/mdm'])
|
||||||
libcalamares.utils.chroot_call(['chmod', '1770', '/var/lib/mdm'])
|
libcalamares.utils.chroot_call(['chmod', '1770', '/var/lib/mdm'])
|
||||||
if default_desktop_environment != None:
|
if default_desktop_environment is not None:
|
||||||
os.system(
|
os.system(
|
||||||
"sed -i \"s|default.desktop|{!s}.desktop|g\" {!s}/etc/mdm/custom.conf".format(default_desktop_environment.desktop_file,root_mount_point))
|
"sed -i \"s|default.desktop|{!s}.desktop|g\" {!s}/etc/mdm/custom.conf".format(default_desktop_environment.desktop_file,root_mount_point))
|
||||||
else:
|
else:
|
||||||
@ -312,7 +312,7 @@ def run():
|
|||||||
['chgrp', 'lxdm', '/etc/lxdm/lxdm.conf'])
|
['chgrp', 'lxdm', '/etc/lxdm/lxdm.conf'])
|
||||||
libcalamares.utils.chroot_call(
|
libcalamares.utils.chroot_call(
|
||||||
['chmod', '+r', '/etc/lxdm/lxdm.conf'])
|
['chmod', '+r', '/etc/lxdm/lxdm.conf'])
|
||||||
if default_desktop_environment != None:
|
if default_desktop_environment is not None:
|
||||||
os.system(
|
os.system(
|
||||||
"sed -i -e \"s|^.*session=.*|session={!s}|\" {!s}/etc/lxdm/lxdm.conf".format(default_desktop_environment.executable,root_mount_point))
|
"sed -i -e \"s|^.*session=.*|session={!s}|\" {!s}/etc/lxdm/lxdm.conf".format(default_desktop_environment.executable,root_mount_point))
|
||||||
else:
|
else:
|
||||||
@ -334,7 +334,7 @@ def run():
|
|||||||
libcalamares.utils.debug("kdm selected but not installed")
|
libcalamares.utils.debug("kdm selected but not installed")
|
||||||
displaymanagers.remove("kdm")
|
displaymanagers.remove("kdm")
|
||||||
|
|
||||||
if username != None:
|
if username is not None:
|
||||||
libcalamares.utils.debug(
|
libcalamares.utils.debug(
|
||||||
"Setting up autologin for user {!s}.".format(username))
|
"Setting up autologin for user {!s}.".format(username))
|
||||||
return set_autologin(username, displaymanagers, default_desktop_environment, root_mount_point)
|
return set_autologin(username, displaymanagers, default_desktop_environment, root_mount_point)
|
||||||
|
@ -137,7 +137,7 @@ class UnpackOperation:
|
|||||||
fslist = ""
|
fslist = ""
|
||||||
|
|
||||||
if entry.sourcefs == "squashfs":
|
if entry.sourcefs == "squashfs":
|
||||||
if shutil.which("unsquashfs") == None:
|
if shutil.which("unsquashfs") is None:
|
||||||
return ("Failed to unpack image", "Failed to find unsquashfs, make sure you have "
|
return ("Failed to unpack image", "Failed to find unsquashfs, make sure you have "
|
||||||
"the squashfs-tools package installed")
|
"the squashfs-tools package installed")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user