本文整理汇总了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')))
示例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, '`'),
])
示例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"'),
])
示例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"'),
])
示例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()
示例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()