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


Python String.Double方法代码示例

本文整理汇总了Python中pygments.token.String.Double方法的典型用法代码示例。如果您正苦于以下问题:Python String.Double方法的具体用法?Python String.Double怎么用?Python String.Double使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pygments.token.String的用法示例。


在下文中一共展示了String.Double方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_can_recover_after_unterminated_string

# 需要导入模块: from pygments.token import String [as 别名]
# 或者: from pygments.token.String import Double [as 别名]
def test_can_recover_after_unterminated_string(lexer):
    assert_tokens_match(lexer,
                        '"x\nx',
                        ((String.Double, '"'), (String.Double, 'x'),
                         (Error, '\n'), (Name, 'x'))) 
开发者ID:pygments,项目名称:pygments,代码行数:7,代码来源:test_basic.py

示例2: test_header_option_value

# 需要导入模块: from pygments.token import String [as 别名]
# 或者: from pygments.token.String import Double [as 别名]
def test_header_option_value(self):
        self.assertEqual(self.get_tokens('Accept:`echo "application/json"`'), [
            (Name, 'Accept'),
            (Operator, ':'),
            (Text, '`'),
            (Name.Builtin, 'echo'),
            (String.Double, '"application/json"'),
            (Text, '`'),
        ]) 
开发者ID:eliangcs,项目名称:http-prompt,代码行数:11,代码来源:test_lexer.py

示例3: test_httpie_post_pipe

# 需要导入模块: from pygments.token import String [as 别名]
# 或者: from pygments.token.String import Double [as 别名]
def test_httpie_post_pipe(self):
        self.assertEqual(self.get_tokens('httpie post | tee "/tmp/test"'), [
            (Keyword, 'httpie'),
            (Keyword, 'post'),
            (Operator, '|'),
            (Text, 'tee'),
            (String.Double, '"/tmp/test"'),
        ]) 
开发者ID:eliangcs,项目名称:http-prompt,代码行数:10,代码来源:test_lexer.py

示例4: test_post_pipe

# 需要导入模块: from pygments.token import String [as 别名]
# 或者: from pygments.token.String import Double [as 别名]
def test_post_pipe(self):
        self.assertEqual(self.get_tokens('post | tee "/tmp/test"'), [
            (Keyword, 'post'),
            (Operator, '|'),
            (Text, 'tee'),
            (String.Double, '"/tmp/test"'),
        ]) 
开发者ID:eliangcs,项目名称:http-prompt,代码行数:9,代码来源:test_lexer.py

示例5: actionRename

# 需要导入模块: from pygments.token import String [as 别名]
# 或者: from pygments.token.String import Double [as 别名]
def actionRename(self):
        cursor = self.textCursor()
        start = cursor.selectionStart()
        end = cursor.selectionEnd()
        selection = cursor.selectedText()
        log.debug("Rename asked for '%s' (%d, %d)" %
                        (selection, start, end))

        if start not in list(self.doc.binding.keys()):
            self.mainwin.showStatus("Rename not available. No info for: '%s'." %
                                    selection)
            return

        # Double check if we support the renaming for the type of
        # object before poping a new window to the user
        t = self.doc.binding[start]
        if t[0] == 'NAME_METHOD_PROTOTYPE':
            class_ = self.current_class
            method_ = t[1]
            if method_ == self.title:
                method_ = 'init'
            log.debug(
                "Found corresponding method: %s -> %s in source file: %s" %
                (class_, method_, self.current_filename))
        elif t[0] == 'NAME_METHOD_INVOKE':
            class_, method_ = t[2].split(' -> ')
            if class_ == 'this':
                class_ = self.current_class
            log.debug(
                "Found corresponding method: %s -> %s in source file: %s" %
                (class_, method_, self.current_filename))
        elif t[0] == 'NAME_PROTOTYPE':
            class_ = t[2] + '.' + t[1]
            log.debug("Found corresponding class: %s in source file: %s" %
                            (class_, self.current_filename))
        elif t[0] == 'NAME_FIELD':
            field_ = t[1]
            log.debug("Found corresponding field: %s in source file: %s" %
                            (field_, self.current_filename))
        else:
            self.mainwin.showStatus(
                "Rename not available. Info ok: '%s' but object not supported."
                % selection)
            return

        rwin = RenameDialog(parent=self,
                            win=self.mainwin,
                            element=selection,
                            info=(start, end))
        rwin.show() 
开发者ID:amimo,项目名称:dcc,代码行数:52,代码来源:sourcewindow.py

示例6: actionRename

# 需要导入模块: from pygments.token import String [as 别名]
# 或者: from pygments.token.String import Double [as 别名]
def actionRename(self):
        cursor = self.textCursor()
        start = cursor.selectionStart()
        end = cursor.selectionEnd()
        selection = cursor.selectedText()
        androconf.debug("Rename asked for '%s' (%d, %d)" %
                        (selection, start, end))

        if start not in self.doc.binding.keys():
            self.mainwin.showStatus("Rename not available. No info for: '%s'." %
                                    selection)
            return

        # Double check if we support the renaming for the type of
        # object before poping a new window to the user
        t = self.doc.binding[start]
        if t[0] == 'NAME_METHOD_PROTOTYPE':
            class_ = self.current_class
            method_ = t[1]
            if method_ == self.title:
                method_ = 'init'
            androconf.debug(
                "Found corresponding method: %s -> %s in source file: %s" %
                (class_, method_, self.current_filename))
        elif t[0] == 'NAME_METHOD_INVOKE':
            class_, method_ = t[2].split(' -> ')
            if class_ == 'this':
                class_ = self.current_class
            androconf.debug(
                "Found corresponding method: %s -> %s in source file: %s" %
                (class_, method_, self.current_filename))
        elif t[0] == 'NAME_PROTOTYPE':
            class_ = t[2] + '.' + t[1]
            androconf.debug("Found corresponding class: %s in source file: %s" %
                            (class_, self.current_filename))
        elif t[0] == 'NAME_FIELD':
            field_ = t[1]
            androconf.debug("Found corresponding field: %s in source file: %s" %
                            (field_, self.current_filename))
        else:
            self.mainwin.showStatus(
                "Rename not available. Info ok: '%s' but object not supported."
                % selection)
            return

        rwin = RenameDialog(parent=self,
                            win=self.mainwin,
                            element=selection,
                            info=(start, end))
        rwin.show() 
开发者ID:xtiankisutsa,项目名称:MARA_Framework,代码行数:52,代码来源:sourcewindow.py


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