aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/bldcontrol
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-09 14:05:09 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-09 17:32:13 +0100
commit58304fcce9727fd89564436771356c033ecd22a3 (patch)
tree88daa489e0e67245dca71a8d1daf783cf5a00308 /lib/toaster/bldcontrol
parentb60261bf8ade14aca31238b50c243c01adcabc59 (diff)
downloadbitbake-contrib-58304fcce9727fd89564436771356c033ecd22a3.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/bldcontrol')
-rw-r--r--lib/toaster/bldcontrol/management/commands/checksettings.py18
-rw-r--r--lib/toaster/bldcontrol/tests.py4
2 files changed, 11 insertions, 11 deletions
diff --git a/lib/toaster/bldcontrol/management/commands/checksettings.py b/lib/toaster/bldcontrol/management/commands/checksettings.py
index 5e70437b2..6b1da1b10 100644
--- a/lib/toaster/bldcontrol/management/commands/checksettings.py
+++ b/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
diff --git a/lib/toaster/bldcontrol/tests.py b/lib/toaster/bldcontrol/tests.py
index f20cc7d4b..32985c328 100644
--- a/lib/toaster/bldcontrol/tests.py
+++ b/lib/toaster/bldcontrol/tests.py
@@ -53,7 +53,7 @@ class BEControllerTests(object):
# setting layers, skip any layer info
bc.setLayers(BITBAKE_LAYER, POKY_LAYERS)
except NotImplementedError:
- print "Test skipped due to command not implemented yet"
+ print("Test skipped due to command not implemented yet")
return True
# We are ok with the exception as we're handling the git already exists
except BuildSetupException:
@@ -79,7 +79,7 @@ class BEControllerTests(object):
# setting layers, skip any layer info
layerSet = bc.setLayers(BITBAKE_LAYER, POKY_LAYERS)
except NotImplementedError:
- print "Test skipped due to command not implemented yet"
+ print("Test skipped due to command not implemented yet")
return True
# We are ok with the exception as we're handling the git already exists
except BuildSetupException: