def testWarning_02(self):
        from externaltools.config import ExternalToolsConfig
        config = ExternalToolsConfig(Application.config)
        config.execWarning = False

        params = LinkClickParams('exec://exec/?com1=sometools')

        Tester.dialogTester.appendOk()
        self.assertEqual(Tester.dialogTester.count, 1)

        self._controller.onLinkClick(None, params)
        self.assertEqual(Tester.dialogTester.count, 1)
        self.assertTrue(params.process)
Пример #2
0
    def onLinkClick(self, page, params):
        """
        Event handler for clicking on link
        """
        if params.link is None:
            return

        urlparams = self._getParams(params.link)
        if not urlparams:
            return

        params.process = True

        commands = self.getCommandsList(urlparams)
        config = ExternalToolsConfig(self._application.config)

        if len(commands) > 1:
            message = _(
                u'Run applications by ExternalTools plugin?\nIt may be unsafe.'
            )
        else:
            message = _(
                u'Run application by ExternalTools plugin?\nIt may be unsafe.')

        if (config.execWarning
                and MessageBox(message, _(u'ExternalTools'), wx.YES_NO
                               | wx.ICON_QUESTION | wx.NO_DEFAULT) != wx.YES):
            return

        for command in commands:
            self._execute(command.command, command.params)
    def tearDown (self):
        from externaltools.config import ExternalToolsConfig
        ExternalToolsConfig (Application.config).clearAll()

        self._controller.destroy()
        self.loader.clear()
        Tester.dialogTester.clear()
Пример #4
0
    def tearDown(self):
        self._dlg.Destroy()
        self._loader.clear()

        from externaltools.config import ExternalToolsConfig
        ExternalToolsConfig(self.application.config).clearAll()

        self.destroyApplication()
Пример #5
0
    def tearDown(self):
        Application.wikiroot = None
        self._dlg.Destroy()
        self._loader.clear()

        from externaltools.config import ExternalToolsConfig
        ExternalToolsConfig(Application.config).clearAll()

        BaseMainWndTest.tearDown(self)
    def setUp (self):
        dirlist = [u'../plugins/externaltools']

        self.loader = PluginsLoader(Application)
        self.loader.load (dirlist)

        from externaltools.commandexec.commandcontroller import CommandController
        self._controller = CommandController (Application)
        self._controller.initialize()

        from externaltools.config import ExternalToolsConfig
        ExternalToolsConfig (Application.config).clearAll()

        Tester.dialogTester.clear()
Пример #7
0
    def setUp(self):
        self.initApplication()

        dirlist = ["plugins/externaltools"]

        self._loader = PluginsLoader(self.application)
        self._loader.load(dirlist)

        from externaltools.config import ExternalToolsConfig
        ExternalToolsConfig(self.application.config).clearAll()

        from externaltools.commandexec.execdialog import ExecDialog
        self._dlg = ExecDialog(self.application.mainWindow)
        Tester.dialogTester.clear()
        Tester.dialogTester.appendOk()
Пример #8
0
 def __init__(self, dialog, application):
     self._dialog = dialog
     self._application = application
     self._config = ExternalToolsConfig(self._application.config)
     self._loadState()