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


Python curses.flash方法代碼示例

本文整理匯總了Python中curses.flash方法的典型用法代碼示例。如果您正苦於以下問題:Python curses.flash方法的具體用法?Python curses.flash怎麽用?Python curses.flash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在curses的用法示例。


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

示例1: flash

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import flash [as 別名]
def flash(self):
        """
        Flash the screen to indicate that an action was invalid.
        """
        if self.config['flash']:
            return curses.flash()
        else:
            return None 
開發者ID:tildeclub,項目名稱:ttrv,代碼行數:10,代碼來源:terminal.py

示例2: prompt_y_or_n

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import flash [as 別名]
def prompt_y_or_n(self, prompt):
        """
        Wrapper around prompt_input for simple yes/no queries.
        """

        ch = self.prompt_input(prompt, key=True)
        if ch in (ord('Y'), ord('y')):
            return True
        elif ch in (ord('N'), ord('n'), None):
            return False
        else:
            self.flash()
            return False 
開發者ID:tildeclub,項目名稱:ttrv,代碼行數:15,代碼來源:terminal.py

示例3: clear_screen

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import flash [as 別名]
def clear_screen(self):
        """
        In the beginning this always called touchwin(). However, a bug
        was discovered in tmux when TERM was set to `xterm-256color`, where
        only part of the screen got redrawn when scrolling. tmux automatically
        sets TERM to `screen-256color`, but many people choose to override
        this in their tmux.conf or .bashrc file which can cause issues.
        Using clearok() instead seems to fix the problem, with the trade off
        of slightly more expensive screen refreshes.

        Update: It was discovered that using clearok() introduced a
        separate bug for urxvt users in which their screen flashed when
        scrolling. Heuristics were added to make it work with as many
        configurations as possible. It's still not perfect
        (e.g. urxvt + xterm-256color) will screen flash, but it should
        work in all cases if the user sets their TERM correctly.

        Reference:
            https://github.com/tildeclub/ttrv/issues/343
            https://github.com/tildeclub/ttrv/issues/323
        """

        if self._term != 'xterm-256color':
            self.stdscr.touchwin()
        else:
            self.stdscr.clearok(True) 
開發者ID:tildeclub,項目名稱:ttrv,代碼行數:28,代碼來源:terminal.py

示例4: clear_screen

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import flash [as 別名]
def clear_screen(self):
        """
        In the beginning this always called touchwin(). However, a bug
        was discovered in tmux when TERM was set to `xterm-256color`, where
        only part of the screen got redrawn when scrolling. tmux automatically
        sets TERM to `screen-256color`, but many people choose to override
        this in their tmux.conf or .bashrc file which can cause issues.
        Using clearok() instead seems to fix the problem, with the trade off
        of slightly more expensive screen refreshes.

        Update: It was discovered that using clearok() introduced a
        separate bug for urxvt users in which their screen flashed when
        scrolling. Heuristics were added to make it work with as many
        configurations as possible. It's still not perfect
        (e.g. urxvt + xterm-256color) will screen flash, but it should
        work in all cases if the user sets their TERM correctly.

        Reference:
            https://github.com/michael-lazar/rtv/issues/343
            https://github.com/michael-lazar/rtv/issues/323
        """

        if self._term != 'xterm-256color':
            self.stdscr.touchwin()
        else:
            self.stdscr.clearok(True) 
開發者ID:michael-lazar,項目名稱:rtv,代碼行數:28,代碼來源:terminal.py


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