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>
This commit is contained in:
parent
72c6953488
commit
c8d2dad049
|
@ -46,9 +46,6 @@ __version__ = "1.11.0"
|
||||||
logger = logging.getLogger("BitBake")
|
logger = logging.getLogger("BitBake")
|
||||||
|
|
||||||
|
|
||||||
#============================================================================#
|
|
||||||
# BBOptions
|
|
||||||
#============================================================================#
|
|
||||||
class BBConfiguration(object):
|
class BBConfiguration(object):
|
||||||
"""
|
"""
|
||||||
Manages build options and configurations for one run
|
Manages build options and configurations for one run
|
||||||
|
@ -89,13 +86,8 @@ warnings.filterwarnings("ignore", category=PendingDeprecationWarning)
|
||||||
warnings.filterwarnings("ignore", category=ImportWarning)
|
warnings.filterwarnings("ignore", category=ImportWarning)
|
||||||
warnings.filterwarnings("ignore", category=DeprecationWarning, module="<string>$")
|
warnings.filterwarnings("ignore", category=DeprecationWarning, module="<string>$")
|
||||||
|
|
||||||
#============================================================================#
|
|
||||||
# main
|
|
||||||
#============================================================================#
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
return_value = 1
|
|
||||||
|
|
||||||
parser = optparse.OptionParser(
|
parser = optparse.OptionParser(
|
||||||
version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__),
|
version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__),
|
||||||
usage = """%prog [options] [package ...]
|
usage = """%prog [options] [package ...]
|
||||||
|
@ -190,7 +182,6 @@ Default BBFILES are the .bb files in the current directory.""")
|
||||||
bb.utils.clean_environment()
|
bb.utils.clean_environment()
|
||||||
|
|
||||||
cooker = bb.cooker.BBCooker(configuration, server)
|
cooker = bb.cooker.BBCooker(configuration, server)
|
||||||
|
|
||||||
cooker.parseCommandLine()
|
cooker.parseCommandLine()
|
||||||
|
|
||||||
serverinfo = server.BitbakeServerInfo(cooker.server)
|
serverinfo = server.BitbakeServerInfo(cooker.server)
|
||||||
|
@ -201,7 +192,7 @@ Default BBFILES are the .bb files in the current directory.""")
|
||||||
logger.removeHandler(loghandler)
|
logger.removeHandler(loghandler)
|
||||||
|
|
||||||
# Setup a connection to the server (cooker)
|
# Setup a connection to the server (cooker)
|
||||||
serverConnection = server.BitBakeServerConnection(serverinfo)
|
server_connection = server.BitBakeServerConnection(serverinfo)
|
||||||
|
|
||||||
# Launch the UI
|
# Launch the UI
|
||||||
if configuration.ui:
|
if configuration.ui:
|
||||||
|
@ -214,17 +205,15 @@ Default BBFILES are the .bb files in the current directory.""")
|
||||||
# Dynamically load the UI based on the ui name. Although we
|
# Dynamically load the UI based on the ui name. Although we
|
||||||
# suggest a fixed set this allows you to have flexibility in which
|
# suggest a fixed set this allows you to have flexibility in which
|
||||||
# ones are available.
|
# ones are available.
|
||||||
uimodule = __import__("bb.ui", fromlist = [ui])
|
module = __import__("bb.ui", fromlist = [ui])
|
||||||
ui_init = getattr(uimodule, ui).init
|
ui_main = getattr(module, ui).main
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
print("FATAL: Invalid user interface '%s' specified. " % ui)
|
print("FATAL: Invalid user interface '%s' specified. " % ui)
|
||||||
print("Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'.")
|
print("Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'.")
|
||||||
else:
|
else:
|
||||||
return_value = server.BitbakeUILauch().launch(serverinfo, ui_init, serverConnection.connection, serverConnection.events)
|
return server.BitbakeUILauch().launch(serverinfo, ui_main, server_connection.connection, server_connection.events)
|
||||||
finally:
|
finally:
|
||||||
serverConnection.terminate()
|
server_connection.terminate()
|
||||||
|
|
||||||
return return_value
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
ret = main()
|
ret = main()
|
||||||
|
|
|
@ -185,7 +185,7 @@ class gtkthread(threading.Thread):
|
||||||
gtk.main()
|
gtk.main()
|
||||||
gtkthread.quit.set()
|
gtkthread.quit.set()
|
||||||
|
|
||||||
def init(server, eventHandler):
|
def main(server, eventHandler):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cmdline = server.runCommand(["getCmdLineAction"])
|
cmdline = server.runCommand(["getCmdLineAction"])
|
||||||
|
|
|
@ -49,7 +49,7 @@ class MainWindow (gtk.Window):
|
||||||
self.set_default_size(640, 480)
|
self.set_default_size(640, 480)
|
||||||
scrolled_window.add (self.cur_build_tv)
|
scrolled_window.add (self.cur_build_tv)
|
||||||
|
|
||||||
def init (server, eventHandler):
|
def main (server, eventHandler):
|
||||||
gobject.threads_init()
|
gobject.threads_init()
|
||||||
gtk.gdk.threads_init()
|
gtk.gdk.threads_init()
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ class BBLogFormatter(logging.Formatter):
|
||||||
else:
|
else:
|
||||||
return logging.Formatter.format(self, record)
|
return logging.Formatter.format(self, record)
|
||||||
|
|
||||||
def init(server, eventHandler):
|
def main(server, eventHandler):
|
||||||
|
|
||||||
# Get values of variables which control our output
|
# Get values of variables which control our output
|
||||||
includelogs = server.runCommand(["getVariable", "BBINCLUDELOGS"])
|
includelogs = server.runCommand(["getVariable", "BBINCLUDELOGS"])
|
||||||
|
|
|
@ -324,7 +324,7 @@ class NCursesUI:
|
||||||
shutdown = shutdown + 1
|
shutdown = shutdown + 1
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def init(server, eventHandler):
|
def main(server, eventHandler):
|
||||||
if not os.isatty(sys.stdout.fileno()):
|
if not os.isatty(sys.stdout.fileno()):
|
||||||
print("FATAL: Unable to run 'ncurses' UI without a TTY.")
|
print("FATAL: Unable to run 'ncurses' UI without a TTY.")
|
||||||
return
|
return
|
||||||
|
|
|
@ -390,7 +390,7 @@ def running_build_failed_cb (running_build, manager):
|
||||||
print("build failed")
|
print("build failed")
|
||||||
manager.notify_build_failed ()
|
manager.notify_build_failed ()
|
||||||
|
|
||||||
def init (server, eventHandler):
|
def main (server, eventHandler):
|
||||||
# Initialise threading...
|
# Initialise threading...
|
||||||
gobject.threads_init()
|
gobject.threads_init()
|
||||||
gtk.gdk.threads_init()
|
gtk.gdk.threads_init()
|
||||||
|
|
Loading…
Reference in New Issue