Example #1
0
    def run(self, params):
        assert self._application.mainWindow is not None

        with ExecDialog(self._application.mainWindow) as dlg:
            controller = ExecDialogController(dlg, self._application)
            if controller.showDialog() == wx.ID_OK:
                begin, end = controller.getResult()
                self._getEditor().turnText(begin, end)
Example #2
0
    def run(self, params):
        assert self._application.mainWindow is not None

        with ExecDialog(self._application.mainWindow) as dlg:
            controller = ExecDialogController(dlg, self._application)
            if controller.showDialog() == wx.ID_OK:
                begin, end = controller.getResult()
                self._getEditor().turnText(begin, end)
Example #3
0
    def testDefault(self):
        from externaltools.commandexec.execdialogcontroller import ExecDialogController

        controller = ExecDialogController(self._dlg, self.application)

        result = controller.showDialog()
        begin, end = controller.getResult()

        self.assertEqual(result, wx.ID_OK)
        self.assertEqual(begin, '(:exec:)')
        self.assertEqual(end, '(:execend:)')
Example #4
0
    def testTitle(self):
        from externaltools.commandexec.execdialogcontroller import ExecDialogController

        controller = ExecDialogController(self._dlg, self.application)

        self._dlg.title = 'Заголовок команды'

        result = controller.showDialog()
        begin, end = controller.getResult()

        self.assertEqual(result, wx.ID_OK)
        self.assertEqual(begin, '(:exec title="Заголовок команды":)')
        self.assertEqual(end, '(:execend:)')
Example #5
0
    def testFormat(self):
        from externaltools.commandexec.execdialogcontroller import ExecDialogController

        controller = ExecDialogController(self._dlg, Application)

        self._dlg.format = 1

        result = controller.showDialog()
        begin, end = controller.getResult()

        self.assertEqual(result, wx.ID_OK)
        self.assertEqual(begin, u'(:exec format="button":)')
        self.assertEqual(end, u'(:execend:)')
Example #6
0
    def testDefault (self):
        from externaltools.commandexec.execdialogcontroller import ExecDialogController

        controller = ExecDialogController (
            self._dlg,
            Application
        )

        result = controller.showDialog()
        begin, end = controller.getResult()

        self.assertEqual (result, wx.ID_OK)
        self.assertEqual (begin, u'(:exec:)')
        self.assertEqual (end, u'(:execend:)')
Example #7
0
    def testTitle (self):
        from externaltools.commandexec.execdialogcontroller import ExecDialogController

        controller = ExecDialogController (
            self._dlg,
            Application
        )

        self._dlg.title = u'Заголовок команды'

        result = controller.showDialog()
        begin, end = controller.getResult()

        self.assertEqual (result, wx.ID_OK)
        self.assertEqual (begin, u'(:exec title="Заголовок команды":)')
        self.assertEqual (end, u'(:execend:)')