diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-12-09 14:05:22 -0500 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-12-09 14:05:24 -0500 |
commit | 4d081a0ed759bd526ab01849d650bd9e8d80ddd1 (patch) | |
tree | 7acac66458ed2d14dc749558d3bc5ccd384f7b3d /bin/bitbake | |
parent | 5670134ab2eb573d39df3c3231677cdb1a1dfc72 (diff) | |
download | bitbake-4d081a0ed759bd526ab01849d650bd9e8d80ddd1.tar.gz |
Rename the ui 'init' method to 'main'
As these may run the UI in a blocking fashion and then return the exit code,
'init' was an inappropriate name, and 'main' is more appropriate.
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'bin/bitbake')
-rwxr-xr-x | bin/bitbake | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/bin/bitbake b/bin/bitbake index fac2dc2a8..41060ae23 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -40,15 +40,11 @@ from bb import cooker from bb import ui from bb import server from bb.server import none -#from bb.server import xmlrpc __version__ = "1.11.0" logger = logging.getLogger("BitBake") -#============================================================================# -# BBOptions -#============================================================================# class BBConfiguration(object): """ Manages build options and configurations for one run @@ -89,13 +85,8 @@ warnings.filterwarnings("ignore", category=PendingDeprecationWarning) warnings.filterwarnings("ignore", category=ImportWarning) warnings.filterwarnings("ignore", category=DeprecationWarning, module="<string>$") -#============================================================================# -# main -#============================================================================# def main(): - return_value = 1 - parser = optparse.OptionParser( version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__), usage = """%prog [options] [package ...] @@ -170,7 +161,6 @@ Default BBFILES are the .bb files in the current directory.""") loghandler = event.LogHandler() logger.addHandler(loghandler) - #server = bb.server.xmlrpc server = bb.server.none # Save a logfile for cooker into the current working directory. When the @@ -186,7 +176,6 @@ Default BBFILES are the .bb files in the current directory.""") bb.utils.clean_environment() cooker = bb.cooker.BBCooker(configuration, server) - cooker.parseCommandLine() serverinfo = server.BitbakeServerInfo(cooker.server) @@ -197,7 +186,7 @@ Default BBFILES are the .bb files in the current directory.""") logger.removeHandler(loghandler) # Setup a connection to the server (cooker) - serverConnection = server.BitBakeServerConnection(serverinfo) + server_connection = server.BitBakeServerConnection(serverinfo) # Launch the UI if configuration.ui: @@ -210,17 +199,15 @@ Default BBFILES are the .bb files in the current directory.""") # Dynamically load the UI based on the ui name. Although we # suggest a fixed set this allows you to have flexibility in which # ones are available. - uimodule = __import__("bb.ui", fromlist = [ui]) - ui_init = getattr(uimodule, ui).init + module = __import__("bb.ui", fromlist = [ui]) + ui_main = getattr(module, ui).main except AttributeError: print("FATAL: Invalid user interface '%s' specified. " % ui) print("Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'.") else: - return_value = ui_init(serverConnection.connection, serverConnection.events) + return ui_main(server_connection.connection, server_connection.events) finally: - serverConnection.terminate() - - return return_value + server_connection.terminate() if __name__ == "__main__": ret = main() |