parameters: (self, select_app)
return_statement: return ret
docstring: 获取APP列表菜单
docstring_summary: 获取APP列表菜单
docstring_tokens: 获取APP列表菜单
function: def get_site_menu(self, select_app):
          '''
          获取APP列表菜单
          '''
          if not self.sys_menu_loaded:self.get_sys_menu()
          if self.show_default_index:
              ret = [{
                          'app_label': '',
                          'title': u'面板',
                          'url': self.url_for('index'),
                          'icon': '',
                          'selected': not select_app
                      }]
          else:
              ret = []
          for app_label,mod in self.app_dict.items():
              if hasattr(mod,'verbose_name'):
                  m_first_url = None
                  if hasattr(mod,'index_url_name'):
                      m_first_url  = self.url_for(mod.index_url_name)
                  else:
                      app_menu = self.sys_menu[app_label]
                      if hasattr(mod,'menus'):
                          m_groups = mod.menus
                          for e in m_groups:
                              m_menus = app_menu[e[0]]['menus']
                              if len(m_menus)>0:
                                  m_first_url = m_menus[0]['url']
                                  break
                      if not m_first_url:
                          d_menus = app_menu['_default_group']['menus']
                          if len(d_menus)>0:
                              m_first_url = d_menus[0]['url']
                          else:
                              m_first_url = '#'
  
                  ret.append({
                              'app_label': app_label,
                              'title': getattr(mod,'verbose_name', unicode(capfirst(app_label))  ),
                              'url': m_first_url,
                              'icon': '',
                              'selected': app_label==select_app
                              })
                  mod.index_url = m_first_url
          return ret
function_tokens: def get_site_menu ( self , select_app ) : if not self . sys_menu_loaded : self . get_sys_menu ( ) if self . show_default_index : ret = [ { 'app_label' : '' , 'title' : u'面板', 'url' : self . url_for ( 'index' ) , 'icon' : '' , 'selected' : not select_app } ] else : ret = [ ] for app_label , mod in self . app_dict . items ( ) : if hasattr ( mod , 'verbose_name' ) : m_first_url = None if hasattr ( mod , 'index_url_name' ) : m_first_url = self . url_for ( mod . index_url_name ) else : app_menu = self . sys_menu [ app_label ] if hasattr ( mod , 'menus' ) : m_groups = mod . menus for e in m_groups : m_menus = app_menu [ e [ 0 ] ] [ 'menus' ] if len ( m_menus ) > 0 : m_first_url = m_menus [ 0 ] [ 'url' ] break if not m_first_url : d_menus = app_menu [ '_default_group' ] [ 'menus' ] if len ( d_menus ) > 0 : m_first_url = d_menus [ 0 ] [ 'url' ] else : m_first_url = '#' ret . append ( { 'app_label' : app_label , 'title' : getattr ( mod , 'verbose_name' , unicode ( capfirst ( app_label ) ) ) , 'url' : m_first_url , 'icon' : '' , 'selected' : app_label == select_app } ) mod . index_url = m_first_url return ret