Exemplo n.º 1
0
    def _getEditorMenu(self):
        it = sh.ctrl('IndentTable')
        indents = it.indent(sh.getEditorMenu())
        level = it.getIndentsLevel(indents)

        if level == 3:
            return sh.getEditorMenu()
        elif level == 4:
            menu_name = sh.getUrlParams().get('top_menu', indents[0][0])
            for k,v in indents:
                if k == menu_name or (' ' in k and k.partition(' ')[0] == menu_name):
                    return it.indentsToConfig(v)
        else:
            return ''
Exemplo n.º 2
0
    def _getEditorMenu(self):
        it = sh.ctrl('IndentTable')
        indents = it.indent(sh.getEditorMenu())
        level = it.getIndentsLevel(indents)

        if level == 3:
            return sh.getEditorMenu()
        elif level == 4:
            menu_name = sh.getUrlParams().get('top_menu', indents[0][0])
            for k, v in indents:
                if k == menu_name or (' ' in k
                                      and k.partition(' ')[0] == menu_name):
                    return it.indentsToConfig(v)
        else:
            return ''
Exemplo n.º 3
0
 def getCurrTopMenuTitle(self):
     it = sh.ctrl('IndentTable')
     indents = it.indent(sh.getEditorMenu())
     if it.getIndentsLevel(indents) == 4:
         return sh.getUrlParams().get('top_menu', indents[0][0]).partition(' ')[0]
     else:
         return ''
Exemplo n.º 4
0
 def getCurrTopMenuTitle(self):
     it = sh.ctrl('IndentTable')
     indents = it.indent(sh.getEditorMenu())
     if it.getIndentsLevel(indents) == 4:
         return sh.getUrlParams().get('top_menu',
                                      indents[0][0]).partition(' ')[0]
     else:
         return ''
Exemplo n.º 5
0
 def getTopMenuTitles(self):
     it = sh.ctrl('IndentTable')
     indents = it.indent(sh.getEditorMenu())
     titles = [i.strip() for i, k in indents
               ] if it.getIndentsLevel(indents) == 4 else []
     return [
         t.partition(' ')[::2] if ' ' in t else (t, sh.editor_config.index)
         for t in titles
     ]
Exemplo n.º 6
0
 def getTopMenuTitles(self):
     it = sh.ctrl('IndentTable')
     indents = it.indent(sh.getEditorMenu())
     titles = [i.strip() for i,k in indents] if it.getIndentsLevel(indents) == 4 else []
     return [t.partition(' ')[::2] if ' ' in t else (t, sh.editor_config.index) for t in titles ]