• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python commandexecparser.CommandExecParser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中externaltools.commandexec.commandexecparser.CommandExecParser的典型用法代码示例。如果您正苦于以下问题:Python CommandExecParser类的具体用法?Python CommandExecParser怎么用?Python CommandExecParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CommandExecParser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:Jenyay,项目名称:outwiker,代码行数:8,代码来源:test_commandexecparser.py


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


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


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


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


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


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


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


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


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


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


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


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


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


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


示例16: testMacrosPage_03

    def testMacrosPage_03(self):
        from externaltools.commandexec.commandexecparser import CommandExecParser

        text = '''gvim \\
%page%'''

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


示例17: testComments_08

    def testComments_08 (self):
        from externaltools.commandexec.commandexecparser import CommandExecParser

        text = u'''gvim \\
 #Комментарий'''

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


示例18: testMacrosAttach_03

    def testMacrosAttach_03(self):
        from externaltools.commandexec.commandexecparser import CommandExecParser

        text = '''gvim Attach:абырвалг.txt'''

        attachPath = os.path.join(self.testPageAttachPath, 'абырвалг.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, [attachPath])
开发者ID:Jenyay,项目名称:outwiker,代码行数:13,代码来源:test_commandexecparser.py


示例19: testCommandExecParser_11_join

    def testCommandExecParser_11_join(self):
        from externaltools.commandexec.commandexecparser import CommandExecParser
        text = r'''gvim \
   "Имя файла"
'''

        parser = CommandExecParser(self.testPage)
        result = parser.parse(text)

        self.assertEqual(len(result), 1)

        self.assertEqual(result[0].command, 'gvim')
        self.assertEqual(result[0].params, ['Имя файла'])
开发者ID:Jenyay,项目名称:outwiker,代码行数:13,代码来源:test_commandexecparser.py


示例20: execute

    def execute(self, params, content):
        """
        Run command.
        The method returns link which will replace the command notation
        """
        paramsDict = Command.parseParams(params)

        commandParser = CommandExecParser(self.parser.page)
        commandsList = commandParser.parse(content)

        htmlMaker = self._createHtmlMaker(paramsDict)
        html = htmlMaker.createHtml(commandsList, paramsDict)

        return html
开发者ID:Jenyay,项目名称:outwiker,代码行数:14,代码来源:commandexec.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python cloak.decloak函数代码示例发布时间:2022-05-24
下一篇:
Python external_strings_utils.truncate_utf8函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap