def graph_menus():
 ret = MPMenuSubMenu('Graphs', [])
 for i in range(len(mestate.graphs)):
  g = mestate.graphs[i]
  path = g.name.split('/')
  name = path[(-1)]
  path = path[:(-1)]
  ret.add_to_submenu(path, MPMenuItem(name, name, ('# graph :%u' % i)))
 return ret

def graph_menus ( ) : ret = MPMenuSubMenu ( 'Graphs' , [ ] ) for i in range ( len ( mestate . graphs ) ) : g = mestate . graphs [ i ] path = g . name . split ( '/' ) name = path [ ( - 1 ) ] path = path [ : ( - 1 ) ] ret . add_to_submenu ( path , MPMenuItem ( name , name , ( '# graph :%u' % i ) ) ) return ret
return menu tree for graphs .