Example #1
0
    def getCurrentProjectHome(self):
        item = self.tree.GetSelection()
        if not self.is_ok(item):
            path = ''
        else:
            path = common.getProjectHome(self.get_node_filename(item))

        return path
Example #2
0
    def getCurrentProjectHome(self):
        item = self.tree.GetSelection()
        if not self.is_ok(item):
            path = ''
        else:
            path = common.getProjectHome(self.get_node_filename(item))

        return path
def other_popup_menu(editor, projectname, menus):
    if 'web2py' in common.getProjectName(editor.filename):
        path = common.getProjectHome(editor.filename)
        if not os.path.exists(os.path.join(path, "web2py.py")):
            common.showerror(
                win,
                tr("setting web2py project is not correctly, you must setting project on web2py folder"
                   ))
            return
        if editor.filename.count(root) > 1:
            common.showerror(
                win,
                tr(" '%s' occur twice, we can't handle this situation" % root))
            return
        if dynamic_menu(editor):
            menus.extend([
                (
                    None,  #parent menu id
                    [
                        (30, 'IDPM_WEB2PY_PROJECT', tr('&Web2py'),
                         wx.ITEM_NORMAL, '', ''),
                        (35, 'IDPM_WEB2PY_PROJECT_CONTROLLERS_VIEW',
                         dynamic_menu(editor), wx.ITEM_NORMAL,
                         'OnWeb2pyProjectFunc',
                         tr('Create a view or open view.')),
                        (38, 'IDPM_WEB2PY_PROJECT_CONTROLLERS_WEB',
                         dynamic_menu(editor, 'web'), wx.ITEM_NORMAL,
                         'OnWeb2pyProjectFunc', tr('visit web site')),
                        (40, '', '-', wx.ITEM_SEPARATOR, None, ''),
                    ]),
                (
                    'IDPM_WEB2PY_PROJECT',
                    [
                        ##                    (100, 'IDPM_WEB2PY_PROJECT_CONTROLLERS_VIEW', dynamic_menu(editor), wx.ITEM_NORMAL, 'OnWeb2pyProjectFunc', tr('Create a view or open view.')),
                        (110, '', '-', wx.ITEM_SEPARATOR, None, ''),
                    ]),
            ])
Example #4
0
def other_popup_menu(editor, projectname, menus):
    if 'web2py' in common.getProjectName(editor.filename):
        path = common.getProjectHome(editor.filename)
        if not os.path.exists(os.path.join(path, "web2py.py")):
            common.showerror(win, tr("setting web2py project is not correctly, you must setting project on web2py folder"))
            return
        if  editor.filename.count(root)>1:
            common.showerror(win, tr(" '%s' occur twice, we can't handle this situation" % root))
            return 
        if dynamic_menu(editor):
            menus.extend([(None, #parent menu id
                [
                    (30, 'IDPM_WEB2PY_PROJECT', tr('&Web2py'), wx.ITEM_NORMAL, '', ''),
                    (35, 'IDPM_WEB2PY_PROJECT_CONTROLLERS_VIEW', dynamic_menu(editor), wx.ITEM_NORMAL, 'OnWeb2pyProjectFunc', tr('Create a view or open view.')),
                    (38, 'IDPM_WEB2PY_PROJECT_CONTROLLERS_WEB', dynamic_menu(editor, 'web'), wx.ITEM_NORMAL, 'OnWeb2pyProjectFunc', tr('visit web site')),
                    
                    (40, '', '-', wx.ITEM_SEPARATOR, None, ''),
                ]),
                ('IDPM_WEB2PY_PROJECT',
                [
##                    (100, 'IDPM_WEB2PY_PROJECT_CONTROLLERS_VIEW', dynamic_menu(editor), wx.ITEM_NORMAL, 'OnWeb2pyProjectFunc', tr('Create a view or open view.')),
                    (110, '', '-', wx.ITEM_SEPARATOR, None, ''),
                ]),
            ])