diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-09 14:05:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-11 10:34:30 +0100 |
commit | 3795f4d6a69dc4ba5208f1d05b89e65bc11d8a10 (patch) | |
tree | 363978673f3e06a03bc2f4a3cb629dd5011cf40a /bitbake/lib/toaster/bldcontrol | |
parent | a9d90f74050e2129171da09ca3427720887f67ee (diff) | |
download | openembedded-core-contrib-3795f4d6a69dc4ba5208f1d05b89e65bc11d8a10.tar.gz |
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py | 18 | ||||
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/tests.py | 4 |
2 files changed, 11 insertions, 11 deletions
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 diff --git a/bitbake/lib/toaster/bldcontrol/tests.py b/bitbake/lib/toaster/bldcontrol/tests.py index f20cc7d4b1..32985c3280 100644 --- a/bitbake/lib/toaster/bldcontrol/tests.py +++ b/bitbake/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: |