本文整理汇总了Python中pyqode.core.api.TextHelper.isspace方法的典型用法代码示例。如果您正苦于以下问题:Python TextHelper.isspace方法的具体用法?Python TextHelper.isspace怎么用?Python TextHelper.isspace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqode.core.api.TextHelper
的用法示例。
在下文中一共展示了TextHelper.isspace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _on_post_key_pressed
# 需要导入模块: from pyqode.core.api import TextHelper [as 别名]
# 或者: from pyqode.core.api.TextHelper import isspace [as 别名]
def _on_post_key_pressed(self, event):
if not event.isAccepted() and not self._ignore_post:
txt = event.text()
next_char = TextHelper(self.editor).get_right_character()
if txt in self.MAPPING:
to_insert = self.MAPPING[txt]
if (not next_char or next_char in self.MAPPING.keys() or
next_char in self.MAPPING.values() or
next_char.isspace()):
TextHelper(self.editor).insert_text(
self.QUOTES_FORMATS[txt] % to_insert)
self._ignore_post = False
示例2: _on_post_key_pressed
# 需要导入模块: from pyqode.core.api import TextHelper [as 别名]
# 或者: from pyqode.core.api.TextHelper import isspace [as 别名]
def _on_post_key_pressed(self, event):
if not event.isAccepted() and not self._ignore_post:
txt = event.text()
trav = self.editor.textCursor()
assert isinstance(trav, QtGui.QTextCursor)
trav.movePosition(trav.Left, trav.MoveAnchor, 2)
literal = TextHelper(self.editor).is_comment_or_string(trav)
if not literal:
next_char = TextHelper(self.editor).get_right_character()
if txt in self.MAPPING:
to_insert = self.MAPPING[txt]
if (not next_char or next_char in self.MAPPING.keys() or
next_char in self.MAPPING.values() or
next_char.isspace()):
TextHelper(self.editor).insert_text(
self.QUOTES_FORMATS[txt] % to_insert)
self._ignore_post = False