當前位置: 首頁>>代碼示例>>Python>>正文


Python _base.NoneditableTextObject類代碼示例

本文整理匯總了Python中UltiSnips.text_objects._base.NoneditableTextObject的典型用法代碼示例。如果您正苦於以下問題:Python NoneditableTextObject類的具體用法?Python NoneditableTextObject怎麽用?Python NoneditableTextObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了NoneditableTextObject類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, parent, token):
        # Find our containing snippet for visual_content
        snippet = parent
        while snippet:
            try:
                self._text = snippet.visual_content.text
                self._mode = snippet.visual_content.mode
                break
            except AttributeError:
                snippet = snippet._parent
        if not self._text:
            self._text = token.alternative_text
            self._mode = "v"

        NoneditableTextObject.__init__(self, parent, token)
開發者ID:LuisFGomez,項目名稱:vim,代碼行數:15,代碼來源:_visual.py

示例2: __init__

    def __init__(self, parent, token):
        # Find our containing snippet for visual_content
        snippet = parent
        while snippet:
            try:
                self._text = snippet.visual_content.text
                self._mode = snippet.visual_content.mode
                break
            except AttributeError:
                snippet = snippet._parent  # pylint:disable=protected-access
        if not self._text:
            self._text = token.alternative_text
            self._mode = "v"

        NoneditableTextObject.__init__(self, parent, token)
        TextObjectTransformation.__init__(self, token)
開發者ID:char101,項目名稱:ultisnips,代碼行數:16,代碼來源:_visual.py

示例3: __init__

    def __init__(self, parent, token):

        # Find our containing snippet for snippet local data
        snippet = parent
        while snippet:
            try:
                self._locals = snippet.locals
                text = snippet.visual_content.text
                mode = snippet.visual_content.mode
                break
            except AttributeError:
                snippet = snippet._parent  # pylint:disable=protected-access
        self._snip = SnippetUtil(token.indent, mode, text)

        self._codes = ((
            "import re, os, vim, string, random",
            "\n".join(snippet.globals.get("!p", [])).replace("\r\n", "\n"),
            token.code.replace("\\`", "`")
        ))
        NoneditableTextObject.__init__(self, parent, token)
開發者ID:char101,項目名稱:ultisnips,代碼行數:20,代碼來源:_python_code.py

示例4: __init__

    def __init__(self, parent, token):

        # Find our containing snippet for snippet local data
        snippet = parent
        while snippet:
            try:
                self._locals = snippet.locals
                text = snippet.visual_content.text
                mode = snippet.visual_content.mode
                context = snippet.context
                break
            except AttributeError as e:
                snippet = snippet._parent  # pylint:disable=protected-access
        self._snip = SnippetUtil(token.indent, mode, text, context, snippet)

        self._codes = ((
            'import re, os, vim, string, random',
            '\n'.join(snippet.globals.get('!p', [])).replace('\r\n', '\n'),
            token.code.replace('\\`', '`')
        ))
        NoneditableTextObject.__init__(self, parent, token)
開發者ID:guns,項目名稱:haus,代碼行數:21,代碼來源:_python_code.py

示例5: __init__

    def __init__(self, parent, token):
        code = token.code.replace("\\`", "`")

        # Find our containing snippet for snippet local data
        snippet = parent
        while snippet:
            try:
                self._locals = snippet.locals
                break
            except AttributeError:
                snippet = snippet._parent
        self._snip = SnippetUtil(token.indent)

        self._globals = {}
        globals = snippet.globals.get("!p", [])
        compatible_exec("\n".join(globals).replace("\r\n", "\n"), self._globals)

        # Add Some convenience to the code
        self._code = "import re, os, vim, string, random\n" + code

        NoneditableTextObject.__init__(self, parent, token)
開發者ID:LuisFGomez,項目名稱:vim,代碼行數:21,代碼來源:_python_code.py

示例6: __init__

    def __init__(self, parent, token):
        self._code = token.code.replace("\\`", "`").strip()

        NoneditableTextObject.__init__(self, parent, token)
開發者ID:char101,項目名稱:ultisnips,代碼行數:4,代碼來源:_viml_code.py

示例7: __init__

 def __init__(self, parent):
     NoneditableTextObject.__init__(
         self, parent, _vim.buf.cursor, _vim.buf.cursor,
         tiebreaker=Position(-1, -1))
開發者ID:ANHVNSE02067,項目名稱:vimconfig-ubuntu,代碼行數:4,代碼來源:_snippet_instance.py

示例8: __init__

 def __init__(self, parent, token):
     NoneditableTextObject.__init__(self, parent, token)
     self._code = token.code.replace('\\`', '`')
     self._tmpdir = _get_tmp()
開發者ID:981746,項目名稱:ultisnips,代碼行數:4,代碼來源:_shell_code.py

示例9: __init__

 def __init__(self, parent, tabstop, token):
     NoneditableTextObject.__init__(self, parent, token)
     self._ts = tabstop
開發者ID:981746,項目名稱:ultisnips,代碼行數:3,代碼來源:_mirror.py


注:本文中的UltiSnips.text_objects._base.NoneditableTextObject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。