From 3795f4d6a69dc4ba5208f1d05b89e65bc11d8a10 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 9 May 2016 14:05:09 +0100 Subject: bitbake: bin, toaster: Fix print and exception syntax This updates the print "" syntax to print() and fixes some exception handling syntax such that its compatible with python v2 and v3. (Bitbake rev: 58304fcce9727fd89564436771356c033ecd22a3) Signed-off-by: Richard Purdie --- .../bldcontrol/management/commands/checksettings.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py') diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py index 5e70437b24..6b1da1b103 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py @@ -70,11 +70,11 @@ class Command(NoArgsCommand): return True if len(be.sourcedir) == 0: - print "\n -- Validation: The layers checkout directory must be set." + print("\n -- Validation: The layers checkout directory must be set.") is_changed = _update_sourcedir() if not be.sourcedir.startswith("/"): - print "\n -- Validation: The layers checkout directory must be set to an absolute path." + print("\n -- Validation: The layers checkout directory must be set to an absolute path.") is_changed = _update_sourcedir() if is_changed: @@ -87,16 +87,16 @@ class Command(NoArgsCommand): return True if len(be.builddir) == 0: - print "\n -- Validation: The build directory must be set." + print("\n -- Validation: The build directory must be set.") is_changed = _update_builddir() if not be.builddir.startswith("/"): - print "\n -- Validation: The build directory must to be set to an absolute path." + print("\n -- Validation: The build directory must to be set to an absolute path.") is_changed = _update_builddir() if is_changed: - print "\nBuild configuration saved" + print("\nBuild configuration saved") be.save() return True @@ -104,20 +104,20 @@ class Command(NoArgsCommand): if be.needs_import: try: config_file = os.environ.get('TOASTER_CONF') - print "\nImporting file: %s" % config_file + print("\nImporting file: %s" % config_file) from loadconf import Command as LoadConfigCommand LoadConfigCommand()._import_layer_config(config_file) # we run lsupdates after config update - print "\nLayer configuration imported. Updating information from the layer sources, please wait.\nYou can re-update any time later by running bitbake/lib/toaster/manage.py lsupdates" + print("\nLayer configuration imported. Updating information from the layer sources, please wait.\nYou can re-update any time later by running bitbake/lib/toaster/manage.py lsupdates") from django.core.management import call_command call_command("lsupdates") # we don't look for any other config files return is_changed except Exception as e: - print "Failure while trying to import the toaster config file %s: %s" %\ - (config_file, e) + print("Failure while trying to import the toaster config file %s: %s" %\ + (config_file, e)) traceback.print_exc(e) return is_changed -- cgit v1.2.3-54-g00ecf