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


Python Token.Transparent方法代码示例

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


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

示例1: _area_is_empty

# 需要导入模块: from prompt_toolkit.token import Token [as 别名]
# 或者: from prompt_toolkit.token.Token import Transparent [as 别名]
def _area_is_empty(self, screen, write_position):
        """
        Return True when the area below the write position is still empty.
        (For floats that should not hide content underneath.)
        """
        wp = write_position
        Transparent = Token.Transparent

        for y in range(wp.ypos, wp.ypos + wp.height):
            if y in screen.data_buffer:
                row = screen.data_buffer[y]

                for x in range(wp.xpos, wp.xpos + wp.width):
                    c = row[x]
                    if c.char != ' ' or c.token != Transparent:
                        return False

        return True 
开发者ID:chrisjim316,项目名称:Liljimbo-Chatbot,代码行数:20,代码来源:containers.py

示例2: __init__

# 需要导入模块: from prompt_toolkit.token import Token [as 别名]
# 或者: from prompt_toolkit.token.Token import Transparent [as 别名]
def __init__(self, default_char=None, initial_width=0, initial_height=0):
        if default_char is None:
            default_char = _CHAR_CACHE[' ', Transparent]

        self.data_buffer = defaultdict(lambda: defaultdict(lambda: default_char))

        #: Escape sequences to be injected.
        self.zero_width_escapes = defaultdict(lambda: defaultdict(lambda: ''))

        #: Position of the cursor.
        self.cursor_position = Point(y=0, x=0)

        #: Visibility of the cursor.
        self.show_cursor = True

        #: (Optional) Where to position the menu. E.g. at the start of a completion.
        #: (We can't use the cursor position, because we don't want the
        #: completion menu to change its position when we browse through all the
        #: completions.)
        self.menu_position = None

        #: Currently used width/height of the screen. This will increase when
        #: data is written to the screen.
        self.width = initial_width or 0
        self.height = initial_height or 0 
开发者ID:chrisjim316,项目名称:Liljimbo-Chatbot,代码行数:27,代码来源:screen.py

示例3: __init__

# 需要导入模块: from prompt_toolkit.token import Token [as 别名]
# 或者: from prompt_toolkit.token.Token import Transparent [as 别名]
def __init__(self, get_tokens, default_char=None, get_default_char=None,
                 align_right=False, align_center=False, has_focus=False):
        assert callable(get_tokens)
        assert default_char is None or isinstance(default_char, Char)
        assert get_default_char is None or callable(get_default_char)
        assert not (default_char and get_default_char)

        self.align_right = to_cli_filter(align_right)
        self.align_center = to_cli_filter(align_center)
        self._has_focus_filter = to_cli_filter(has_focus)

        self.get_tokens = get_tokens

        # Construct `get_default_char` callable.
        if default_char:
            get_default_char = lambda _: default_char
        elif not get_default_char:
            get_default_char = lambda _: Char(' ', Token.Transparent)

        self.get_default_char = get_default_char

        #: Cache for the content.
        self._content_cache = SimpleCache(maxsize=18)
        self._token_cache = SimpleCache(maxsize=1)
            # Only cache one token list. We don't need the previous item.

        # Render info for the mouse support.
        self._tokens = None 
开发者ID:chrisjim316,项目名称:Liljimbo-Chatbot,代码行数:30,代码来源:controls.py


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