當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。