示例#1
0
    def OnDone(self, event):
        if event.returncode == 0:
            if not os.getenv("GRASS_ADDON_BASE"):
                SetAddOnPath(key="BASE")

            globalvar.UpdateGRASSAddOnCommands()
            toolboxesOutdated()
示例#2
0
    def OnDone(self, event):
        if event.returncode == 0:
            if not os.getenv('GRASS_ADDON_BASE'):
                SetAddOnPath(key='BASE')

            globalvar.UpdateGRASSAddOnCommands()
            toolboxesOutdated()
示例#3
0
文件: extensions.py 项目: caomw/grass
    def OnUninstall(self, event):
        """Uninstall selected extensions"""
        eList = self._getSelectedExtensions()
        if not eList:
            return

        for ext in eList:
            files = RunCommand(
                "g.extension", parent=self, read=True, quiet=True, extension=ext, operation="remove"
            ).splitlines()
            dlg = wx.MessageDialog(
                parent=self,
                message=_(
                    "List of files to be removed:\n%(files)s\n\n" "Do you want really to remove <%(ext)s> extension?"
                )
                % {"files": os.linesep.join(files), "ext": ext},
                caption=_("Remove extension"),
                style=wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION,
            )

            if dlg.ShowModal() == wx.ID_YES:
                RunCommand("g.extension", flags="f", parent=self, quiet=True, extension=ext, operation="remove")

        self.extList.LoadData()

        # update prompt
        globalvar.UpdateGRASSAddOnCommands(eList)
        toolboxesOutdated()
示例#4
0
文件: extensions.py 项目: caomw/grass
    def OnDone(self, cmd, returncode):
        if returncode == 0:
            if not os.getenv("GRASS_ADDON_BASE"):
                SetAddOnPath(key="BASE")

            globalvar.UpdateGRASSAddOnCommands()
            toolboxesOutdated()
示例#5
0
 def OnUninstall(self, event):
     """Uninstall selected extensions"""
     eList = self._getSelectedExtensions()
     if not eList:
         return
     
     for ext in eList:
         files = RunCommand('g.extension', parent = self, read = True, quiet = True,
                            extension = ext, operation = 'remove').splitlines()
         dlg = wx.MessageDialog(parent = self,
                                message = _("List of files to be removed:\n%(files)s\n\n"
                                            "Do you want really to remove <%(ext)s> extension?") % \
                                    { 'files' : os.linesep.join(files), 'ext' : ext },
                                caption = _("Remove extension"),
                                style = wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
         
         if dlg.ShowModal() ==  wx.ID_YES:
             RunCommand('g.extension', flags = 'f', parent = self, quiet = True,
                        extension = ext, operation = 'remove')
     
     self.extList.LoadData()
     
     # update prompt
     globalvar.UpdateGRASSAddOnCommands(eList)
     toolboxesOutdated()
示例#6
0
 def OnDone(self, cmd, returncode):
     if returncode == 0:
         if not os.getenv('GRASS_ADDON_BASE'):
             SetAddOnPath(key = 'BASE')
         
         globalvar.UpdateGRASSAddOnCommands()
         toolboxesOutdated()