本文整理汇总了Python中externaltools.commandexec.commandexecparser.CommandExecParser.parse方法的典型用法代码示例。如果您正苦于以下问题:Python CommandExecParser.parse方法的具体用法?Python CommandExecParser.parse怎么用?Python CommandExecParser.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类externaltools.commandexec.commandexecparser.CommandExecParser
的用法示例。
在下文中一共展示了CommandExecParser.parse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testCommandExecParser_01_empty
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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
# 需要导入模块: from externaltools.commandexec.commandexecparser import CommandExecParser [as 别名]
# 或者: from externaltools.commandexec.commandexecparser.CommandExecParser import parse [as 别名]
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')