def testStatus_06(self): from externaltools.commandexec.execinfo import ExecInfo commands = [ ExecInfo('gvim', ['abyrvalg glavryba']), ExecInfo('gvim', ['abyrvalg glavryba']), ] title = self._controller.getStatusTitle(commands) rightTitle = '>>> gvim "abyrvalg glavryba" ...' self.assertEqual(title, rightTitle)
def testStatus_02(self): from externaltools.commandexec.execinfo import ExecInfo commands = [ ExecInfo('gvim', []), ExecInfo('krusader', []), ] title = self._controller.getStatusTitle(commands) rightTitle = '>>> gvim ...' self.assertEqual(title, rightTitle)
def getCommandsList(self, urlparams): """ Return list of the ExecInfo. Macros will be replaced in params urlparams is dictionary with params from url. """ from externaltools.commandexec.execinfo import ExecInfo result = [] comindex = 1 comparams = PROTO_COMMAND.format(number=comindex) encoding = getOS().filesEncoding while comparams in urlparams: command = unicode(urlparams[comparams][0], "utf8").encode(encoding) params = [ unicode(param, "utf8").encode(encoding) for param in urlparams[comparams][1:] ] result.append(ExecInfo(command, params)) comindex += 1 comparams = PROTO_COMMAND.format(number=comindex) return result
def testStatus_03 (self): from externaltools.commandexec.execinfo import ExecInfo commands = [ExecInfo ('gvim', ['abyrvalg'])] title = self._controller.getStatusTitle (commands) rightTitle = u'>>> gvim abyrvalg' self.assertEqual (title, rightTitle)
def getCommandsList(self, urlparams): """ Return list of the ExecInfo. Macros will be replaced in params urlparams is dictionary with params from url. """ from externaltools.commandexec.execinfo import ExecInfo result = [] comindex = 1 comparams = PROTO_COMMAND.format(number=comindex) while comparams in urlparams: command = urlparams[comparams][0] params = [param for param in urlparams[comparams][1:]] result.append(ExecInfo(command, params)) comindex += 1 comparams = PROTO_COMMAND.format(number=comindex) return result