[packages] Make dummy backend slower

- insert sleeps to make it slower (easier when testing)
- improve debug logging clarity by noting where the messages
  are coming from
This commit is contained in:
Adriaan de Groot 2020-03-04 21:31:47 -05:00
parent 1f34460d39
commit d3828a82fc

View file

@ -332,19 +332,23 @@ class PMDummy(PackageManager):
backend = "dummy"
def install(self, pkgs, from_local=False):
libcalamares.utils.debug("Installing " + str(pkgs))
from time import sleep
libcalamares.utils.debug("Dummy backend: Installing " + str(pkgs))
sleep(3)
def remove(self, pkgs):
libcalamares.utils.debug("Removing " + str(pkgs))
from time import sleep
libcalamares.utils.debug("Dummy backend: Removing " + str(pkgs))
sleep(3)
def update_db(self):
libcalamares.utils.debug("Updating DB")
libcalamares.utils.debug("Dummy backend: Updating DB")
def update_system(self):
libcalamares.utils.debug("Updating System")
libcalamares.utils.debug("Dummy backend: Updating System")
def run(self, script):
libcalamares.utils.debug("Running script '" + str(script) + "'")
libcalamares.utils.debug("Dummy backend: Running script '" + str(script) + "'")
class PMPisi(PackageManager):
@ -502,7 +506,7 @@ def run_operations(pkgman, entry):
libcalamares.utils.warning("Unknown package-operation key {!s}".format(key))
completed_packages += len(package_list)
libcalamares.job.setprogress(completed_packages * 1.0 / total_packages)
libcalamares.utils.debug(pretty_name())
libcalamares.utils.debug("Pretty name: {!s}, setting progress..".format(pretty_name()))
group_packages = 0
_change_mode(None)