def setup_menus():
 global TopMenu
 TopMenu.add(MPMenuSubMenu('Display', items=[MPMenuItem('Map', 'Map', '# map'), MPMenuItem('Save Graph', 'Save', '# save'), MPMenuItem('Reload Graphs', 'Reload', '# reload')]))
 TopMenu.add(graph_menus())
 TopMenu.add(MPMenuSubMenu('FlightMode', items=flightmode_menu()))
 mestate.console.set_menu(TopMenu, menu_callback)

def setup_menus ( ) : global TopMenu TopMenu . add ( MPMenuSubMenu ( 'Display' , items = [ MPMenuItem ( 'Map' , 'Map' , '# map' ) , MPMenuItem ( 'Save Graph' , 'Save' , '# save' ) , MPMenuItem ( 'Reload Graphs' , 'Reload' , '# reload' ) ] ) ) TopMenu . add ( graph_menus ( ) ) TopMenu . add ( MPMenuSubMenu ( 'FlightMode' , items = flightmode_menu ( ) ) ) mestate . console . set_menu ( TopMenu , menu_callback )
setup console menus .