当前位置: 首页>>代码示例>>Python>>正文


Python CommandExecParser.parse方法代码示例

本文整理汇总了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)
开发者ID:Jenyay,项目名称:outwiker,代码行数:10,代码来源:test_commandexecparser.py

示例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'])
开发者ID:LihMeh,项目名称:outwiker,代码行数:12,代码来源:commandexecparser.py

示例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'])
开发者ID:Jenyay,项目名称:outwiker,代码行数:12,代码来源:test_commandexecparser.py

示例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)
开发者ID:Jenyay,项目名称:outwiker,代码行数:12,代码来源:test_commandexecparser.py

示例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'])
开发者ID:Jenyay,项目名称:outwiker,代码行数:12,代码来源:test_commandexecparser.py

示例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'])
开发者ID:LihMeh,项目名称:outwiker,代码行数:12,代码来源:commandexecparser.py

示例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'])
开发者ID:Jenyay,项目名称:outwiker,代码行数:13,代码来源:test_commandexecparser.py

示例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%'])
开发者ID:Jenyay,项目名称:outwiker,代码行数:13,代码来源:test_commandexecparser.py

示例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%'])
开发者ID:LihMeh,项目名称:outwiker,代码行数:13,代码来源:commandexecparser.py

示例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', '#', 'Комментарий'])
开发者ID:Jenyay,项目名称:outwiker,代码行数:13,代码来源:test_commandexecparser.py

示例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])
开发者ID:LihMeh,项目名称:outwiker,代码行数:13,代码来源:commandexecparser.py

示例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'])
开发者ID:Jenyay,项目名称:outwiker,代码行数:13,代码来源:test_commandexecparser.py

示例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')
开发者ID:Jenyay,项目名称:outwiker,代码行数:13,代码来源:test_commandexecparser.py

示例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])
开发者ID:Jenyay,项目名称:outwiker,代码行数:13,代码来源:test_commandexecparser.py

示例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')
开发者ID:LihMeh,项目名称:outwiker,代码行数:13,代码来源:commandexecparser.py


注:本文中的externaltools.commandexec.commandexecparser.CommandExecParser.parse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。