[PEP 8] General Style Part 1

This commit is contained in:
Gormogon 2015-02-18 09:37:03 -05:00
parent 5d5519b7b0
commit d8df3d7a59
5 changed files with 33 additions and 22 deletions

View File

@ -22,9 +22,11 @@
import libcalamares import libcalamares
from libcalamares.utils import chroot_call from libcalamares.utils import chroot_call
def run_dracut(): def run_dracut():
return chroot_call(['dracut', '-f']) return chroot_call(['dracut', '-f'])
def run(): def run():
returnCode = run_dracut() returnCode = run_dracut()
if returnCode != 0: if returnCode != 0:

View File

@ -149,6 +149,7 @@ class FstabGenerator(object):
if partition["mountPoint"]: if partition["mountPoint"]:
mkdir_p(self.root_mount_point + partition["mountPoint"]) mkdir_p(self.root_mount_point + partition["mountPoint"])
def run(): def run():
gs = libcalamares.globalstorage gs = libcalamares.globalstorage
conf = libcalamares.job.configuration conf = libcalamares.job.configuration

View File

@ -37,15 +37,23 @@ def install_grub(boot_loader, fw_type):
distribution = branding["bootloaderEntryName"] distribution = branding["bootloaderEntryName"]
file_name_sanitizer = str.maketrans(" /", "_-") file_name_sanitizer = str.maketrans(" /", "_-")
efi_bootloader_id = distribution.translate(file_name_sanitizer) efi_bootloader_id = distribution.translate(file_name_sanitizer)
check_chroot_call([libcalamares.job.configuration["grubInstall"], "--target=x86_64-efi", "--efi-directory={!s}".format(efi_directory), "--bootloader-id={!s}".format(efi_bootloader_id)]) check_chroot_call(
[libcalamares.job.configuration["grubInstall"], "--target=x86_64-efi",
"--efi-directory={!s}".format(efi_directory),
"--bootloader-id={!s}".format(efi_bootloader_id)])
# Workaround for some UEFI firmwares # Workaround for some UEFI firmwares
check_chroot_call(["mkdir", "-p", "{!s}/boot".format(efi_directory_firmware)]) check_chroot_call(["mkdir", "-p", "{!s}/boot".format(efi_directory_firmware)])
check_chroot_call(["cp", "{!s}/{!s}/grubx64.efi".format(efi_directory_firmware,efi_bootloader_id), "{!s}/boot/bootx64.efi".format(efi_directory_firmware)]) check_chroot_call(["cp", "{!s}/{!s}/grubx64.efi".format(efi_directory_firmware,
efi_bootloader_id),
"{!s}/boot/bootx64.efi".format(efi_directory_firmware)])
else: else:
install_path = boot_loader["installPath"] install_path = boot_loader["installPath"]
check_chroot_call([libcalamares.job.configuration["grubInstall"], "--target=i386-pc", install_path]) check_chroot_call(
[libcalamares.job.configuration["grubInstall"], "--target=i386-pc",
install_path])
check_chroot_call([libcalamares.job.configuration["grubMkconfig"], "-o", libcalamares.job.configuration["grubCfg"]]) check_chroot_call([libcalamares.job.configuration["grubMkconfig"], "-o",
libcalamares.job.configuration["grubCfg"]])
def run(): def run():

View File

@ -23,7 +23,6 @@ import os
def modify_grub_default(partitions, root_mount_point, distributor): def modify_grub_default(partitions, root_mount_point, distributor):
default_dir = os.path.join(root_mount_point, "etc/default") default_dir = os.path.join(root_mount_point, "etc/default")
default_grub = os.path.join(default_dir, "grub") default_grub = os.path.join(default_dir, "grub")
distributor_replace = distributor.replace("'", "'\\''") distributor_replace = distributor.replace("'", "'\\''")
@ -94,6 +93,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
return None return None
def run(): def run():
partitions = libcalamares.globalstorage.value("partitions") partitions = libcalamares.globalstorage.value("partitions")
root_mount_point = libcalamares.globalstorage.value("rootMountPoint") root_mount_point = libcalamares.globalstorage.value("rootMountPoint")