[PEP8] fix several modules

This commit is contained in:
Philip 2017-06-23 12:29:44 +02:00
parent 09f11a4091
commit a1e1c66f1d
3 changed files with 20 additions and 8 deletions

View File

@ -82,8 +82,10 @@ class OperationTracker:
libcalamares.job.setprogress(self.progress)
ON_POSIX = 'posix' in sys.builtin_module_names
class PacmanController:
def __init__(self, root):
self.__root = root
@ -146,8 +148,13 @@ class PacmanController:
self.tracker.downloaded += 1
phase = 1
debug("Downloading: {}".format(dl[0]))
debug("Downloaded packages: {}".format(self.tracker.downloaded))
self.tracker.send_progress(self.tracker.downloaded, phase)
debug("Downloaded packages: {}".format(
self.tracker.downloaded
))
self.tracker.send_progress(
self.tracker.downloaded,
phase
)
last = dl
elif inst:
@ -197,7 +204,7 @@ class PacmanController:
elif key == "localInstall":
for pkg in self.operations[key]:
pkgs.extend([pkg["package"]])
self.install(pkgs,local=True)
self.install(pkgs, local=True)
elif key == "remove":
for pkg in self.operations[key]:
pkgs.extend([pkg["package"]])
@ -244,7 +251,7 @@ class ChrootController:
dest = self.root + target["name"]
if not os.path.exists(dest):
debug("Create: {}".format(dest))
mod = int(target["mode"],8)
mod = int(target["mode"], 8)
debug("Mode: {}".format(oct(mod)))
os.makedirs(dest, mode=mod)
@ -262,7 +269,6 @@ class ChrootController:
cal_umask = os.umask(0)
self.make_dirs()
path = join(self.root, "run")
#debug("Fix permissions: {}".format(path))
os.chmod(path, 0o755)
os.umask(cal_umask)
self.copy_file('etc/pacman-mirrors.conf')
@ -277,6 +283,7 @@ class ChrootController:
return pacman.run()
def run():
"""
Create chroot dirs and install pacman,

View File

@ -112,8 +112,8 @@ def run():
if ec != 0:
return "Cannot enable systemd service {}".format(dm), \
"systemctl enable call in chroot returned error code " \
"{}".format(ec)
"systemctl enable call in chroot returned error " \
"code {}".format(ec)
else:
libcalamares.utils.debug(
"Cannot enable systemd service {}".format(dm)

View File

@ -79,7 +79,12 @@ class ServicesController:
def update(self, action, state):
for svc in self.services[state]:
if exists(self.root + "/etc/init.d/" + svc["name"]):
target_env_call(["rc-update", action, svc["name"], svc["runlevel"]])
target_env_call([
"rc-update",
action,
svc["name"],
svc["runlevel"]
])
def run(self):
self.configure()