diff options
| author | Chris Larson <chris_larson@mentor.com> | 2010-12-09 14:05:22 -0500 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:47 +0000 |
| commit | c8d2dad04960746d38d28bb2c5aba8363534541a (patch) | |
| tree | 1871652c0d8d52ad23d216db0da03392b276c11d /bitbake/bin | |
| parent | 72c6953488149f1c1fe93a1191f5aa88e6f128de (diff) | |
| download | poky-c8d2dad04960746d38d28bb2c5aba8363534541a.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.
(Bitbake rev: 4d081a0ed759bd526ab01849d650bd9e8d80ddd1)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/bin')
| -rwxr-xr-x | bitbake/bin/bitbake | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 1dbaf96b41..51cb87e285 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
| @@ -46,9 +46,6 @@ __version__ = "1.11.0" | |||
| 46 | logger = logging.getLogger("BitBake") | 46 | logger = logging.getLogger("BitBake") |
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | #============================================================================# | ||
| 50 | # BBOptions | ||
| 51 | #============================================================================# | ||
| 52 | class BBConfiguration(object): | 49 | class BBConfiguration(object): |
| 53 | """ | 50 | """ |
| 54 | Manages build options and configurations for one run | 51 | Manages build options and configurations for one run |
| @@ -89,13 +86,8 @@ warnings.filterwarnings("ignore", category=PendingDeprecationWarning) | |||
| 89 | warnings.filterwarnings("ignore", category=ImportWarning) | 86 | warnings.filterwarnings("ignore", category=ImportWarning) |
| 90 | warnings.filterwarnings("ignore", category=DeprecationWarning, module="<string>$") | 87 | warnings.filterwarnings("ignore", category=DeprecationWarning, module="<string>$") |
| 91 | 88 | ||
| 92 | #============================================================================# | ||
| 93 | # main | ||
| 94 | #============================================================================# | ||
| 95 | 89 | ||
| 96 | def main(): | 90 | def main(): |
| 97 | return_value = 1 | ||
| 98 | |||
| 99 | parser = optparse.OptionParser( | 91 | parser = optparse.OptionParser( |
| 100 | version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__), | 92 | version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__), |
| 101 | usage = """%prog [options] [package ...] | 93 | usage = """%prog [options] [package ...] |
| @@ -190,7 +182,6 @@ Default BBFILES are the .bb files in the current directory.""") | |||
| 190 | bb.utils.clean_environment() | 182 | bb.utils.clean_environment() |
| 191 | 183 | ||
| 192 | cooker = bb.cooker.BBCooker(configuration, server) | 184 | cooker = bb.cooker.BBCooker(configuration, server) |
| 193 | |||
| 194 | cooker.parseCommandLine() | 185 | cooker.parseCommandLine() |
| 195 | 186 | ||
| 196 | serverinfo = server.BitbakeServerInfo(cooker.server) | 187 | serverinfo = server.BitbakeServerInfo(cooker.server) |
| @@ -201,7 +192,7 @@ Default BBFILES are the .bb files in the current directory.""") | |||
| 201 | logger.removeHandler(loghandler) | 192 | logger.removeHandler(loghandler) |
| 202 | 193 | ||
| 203 | # Setup a connection to the server (cooker) | 194 | # Setup a connection to the server (cooker) |
| 204 | serverConnection = server.BitBakeServerConnection(serverinfo) | 195 | server_connection = server.BitBakeServerConnection(serverinfo) |
| 205 | 196 | ||
| 206 | # Launch the UI | 197 | # Launch the UI |
| 207 | if configuration.ui: | 198 | if configuration.ui: |
| @@ -214,17 +205,15 @@ Default BBFILES are the .bb files in the current directory.""") | |||
| 214 | # Dynamically load the UI based on the ui name. Although we | 205 | # Dynamically load the UI based on the ui name. Although we |
| 215 | # suggest a fixed set this allows you to have flexibility in which | 206 | # suggest a fixed set this allows you to have flexibility in which |
| 216 | # ones are available. | 207 | # ones are available. |
| 217 | uimodule = __import__("bb.ui", fromlist = [ui]) | 208 | module = __import__("bb.ui", fromlist = [ui]) |
| 218 | ui_init = getattr(uimodule, ui).init | 209 | ui_main = getattr(module, ui).main |
| 219 | except AttributeError: | 210 | except AttributeError: |
| 220 | print("FATAL: Invalid user interface '%s' specified. " % ui) | 211 | print("FATAL: Invalid user interface '%s' specified. " % ui) |
| 221 | print("Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'.") | 212 | print("Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'.") |
| 222 | else: | 213 | else: |
| 223 | return_value = server.BitbakeUILauch().launch(serverinfo, ui_init, serverConnection.connection, serverConnection.events) | 214 | return server.BitbakeUILauch().launch(serverinfo, ui_main, server_connection.connection, server_connection.events) |
| 224 | finally: | 215 | finally: |
| 225 | serverConnection.terminate() | 216 | server_connection.terminate() |
| 226 | |||
| 227 | return return_value | ||
| 228 | 217 | ||
| 229 | if __name__ == "__main__": | 218 | if __name__ == "__main__": |
| 230 | ret = main() | 219 | ret = main() |
