本文整理汇总了Python中externaltools.commandexec.commandexecparser.CommandExecParser类的典型用法代码示例。如果您正苦于以下问题:Python CommandExecParser类的具体用法?Python CommandExecParser怎么用?Python CommandExecParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommandExecParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testCommandExecParser_01_empty
def testCommandExecParser_01_empty(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = ''
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 0)
示例2: testCommandExecParser_14_params
def testCommandExecParser_14_params (self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = u'gvim -d'
parser = CommandExecParser (self.testPage)
result = parser.parse (text)
self.assertEqual (len (result), 1)
self.assertEqual (result[0].command, u'gvim')
self.assertEqual (result[0].params, [u'-d'])
示例3: testCommandExecParser_15_params
def testCommandExecParser_15_params(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = 'gvim "c:\\temp\\abyrvalg\\rrr\\nnn"'
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 1)
self.assertEqual(result[0].command, 'gvim')
self.assertEqual(result[0].params, ['c:\\temp\\abyrvalg\\rrr\\nnn'])
示例4: testCommandExecParser_02
def testCommandExecParser_02(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = 'gvim'
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 1)
self.assertEqual(result[0].command, 'gvim')
self.assertEqual(len(result[0].params), 0)
示例5: testCommandExecParser_06_params
def testCommandExecParser_06_params(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = ' gvim -d файл1.txt файл2.txt '
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 1)
self.assertEqual(result[0].command, 'gvim')
self.assertEqual(result[0].params, ['-d', 'файл1.txt', 'файл2.txt'])
示例6: testCommandExecParser_08_params
def testCommandExecParser_08_params (self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = ur' gvim -d "Имя файла 1\".txt" "Имя файла 2.txt" '
parser = CommandExecParser (self.testPage)
result = parser.parse (text)
self.assertEqual (len (result), 1)
self.assertEqual (result[0].command, u'gvim')
self.assertEqual (result[0].params, [u'-d', u'Имя файла 1".txt', u'Имя файла 2.txt'])
示例7: testMacrosFolder_02
def testMacrosFolder_02(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = '''gvim %folder%/111.txt'''
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 1)
self.assertEqual(result[0].command, 'gvim')
self.assertEqual(result[0].params, [self.testPage.path + '/111.txt'])
示例8: testMacrosFolder_03
def testMacrosFolder_03(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = '''gvim %FOLDER%'''
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 1)
self.assertEqual(result[0].command, 'gvim')
self.assertEqual(result[0].params, ['%FOLDER%'])
示例9: testMacrosAttach_02
def testMacrosAttach_02 (self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = u'''gvim %ATTACH%'''
parser = CommandExecParser (self.testPage)
result = parser.parse (text)
self.assertEqual (len (result), 1)
self.assertEqual (result[0].command, u'gvim')
self.assertEqual (result[0].params, [u'%ATTACH%'])
示例10: testComments_04
def testComments_04(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = '''gvim fname # Комментарий'''
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 1)
self.assertEqual(result[0].command, 'gvim')
self.assertEqual(result[0].params, ['fname', '#', 'Комментарий'])
示例11: testMacrosHtml_01
def testMacrosHtml_01 (self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = u'''gvim %html%'''
parser = CommandExecParser (self.testPage)
result = parser.parse (text)
self.assertEqual (len (result), 1)
self.assertEqual (result[0].command, u'gvim')
self.assertEqual (result[0].params, [self.testPageHtmlPath])
示例12: testMacrosAttach_06
def testMacrosAttach_06(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = '''gvim attach:абырвалг.txt'''
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 1)
self.assertEqual(result[0].command, 'gvim')
self.assertEqual(result[0].params, ['attach:абырвалг.txt'])
示例13: testMacrosApp_02
def testMacrosApp_02(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = '''%attach%/gvim'''
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 1)
self.assertEqual(result[0].command,
self.testPageAttachPath + '/gvim')
示例14: testMacrosAttach_01
def testMacrosAttach_01(self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = '''gvim %attach%'''
parser = CommandExecParser(self.testPage)
result = parser.parse(text)
self.assertEqual(len(result), 1)
self.assertEqual(result[0].command, 'gvim')
self.assertEqual(result[0].params, [self.testPageAttachPath])
示例15: testMacrosApp_01
def testMacrosApp_01 (self):
from externaltools.commandexec.commandexecparser import CommandExecParser
text = u'''%folder%/gvim'''
parser = CommandExecParser (self.testPage)
result = parser.parse (text)
self.assertEqual (len (result), 1)
self.assertEqual (result[0].command,
self.testPage.path + u'/gvim')