Python-style: pep8 fixes

This commit is contained in:
Adriaan de Groot 2017-08-15 11:39:58 +02:00
parent 22c0ee5dbb
commit c694792e4f
2 changed files with 8 additions and 4 deletions

View File

@ -39,9 +39,11 @@ _ = gettext.translation("python",
libcalamares.globalstorage.gettext_languages(), libcalamares.globalstorage.gettext_languages(),
fallback=True).gettext fallback=True).gettext
def pretty_name(): def pretty_name():
return _("Dummy python job.") return _("Dummy python job.")
def run(): def run():
"""Dummy python job.""" """Dummy python job."""
os.system("/bin/sh -c \"touch ~/calamares-dummypython\"") os.system("/bin/sh -c \"touch ~/calamares-dummypython\"")
@ -81,15 +83,15 @@ def run():
sleep(1) sleep(1)
try: try:
l = list(libcalamares.job.configuration["a_list"]) configlist = list(libcalamares.job.configuration["a_list"])
except KeyError: except KeyError:
l = ["no list"] configlist = ["no list"]
c = 1 c = 1
for k in l: for k in configlist:
libcalamares.utils.debug(_("Dummy python step {}").format(str(k))) libcalamares.utils.debug(_("Dummy python step {}").format(str(k)))
sleep(1) sleep(1)
libcalamares.job.setprogress( c * 1.0 / len(l) ) libcalamares.job.setprogress(c * 1.0 / len(configlist))
c += 1 c += 1
sleep(3) sleep(3)

View File

@ -30,9 +30,11 @@ _ = gettext.translation("python",
libcalamares.globalstorage.gettext_languages(), libcalamares.globalstorage.gettext_languages(),
fallback=True).gettext fallback=True).gettext
def pretty_name(): def pretty_name():
return _("Generate machine-id.") return _("Generate machine-id.")
def run(): def run():
""" """
Generate machine-id using dbus and systemd. Generate machine-id using dbus and systemd.