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


Python curses.doupdate方法代碼示例

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


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

示例1: setup_and_draw_screen

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def setup_and_draw_screen(self):
        self.max_y, self.max_x = self.stdscr.getmaxyx()
        self.head_win = curses.newwin(1, self.max_x, 0, 0)
        self.body_win = curses.newwin(self.max_y - 2, self.max_x, 1, 0)
        self.footer_win = curses.newwin(1, self.max_x, self.max_y - 1, 0)
        self.login_win = curses.newwin(self.max_y - 2, self.max_x, 1, 0)

        self.init_head()
        self.init_body()
        self.init_footer()

        self.footer.set_screen(self.footer_win)
        self.body_win.keypad(1)
        curses.doupdate() 
開發者ID:tdoly,項目名稱:baidufm-py,代碼行數:16,代碼來源:fm_cli.py

示例2: __del__

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def __del__(self):
        del self.panel
        del self.win
        curses.panel.update_panels()
        curses.doupdate() 
開發者ID:caktux,項目名稱:pytrader,代碼行數:7,代碼來源:pytrader.py

示例3: done_paint

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def done_paint(self):
        """update the sreen after paint operations, this will invoke all
        necessary stuff to refresh all (possibly overlapping) windows in
        the right order and then push it to the screen"""
        curses.panel.update_panels()
        curses.doupdate() 
開發者ID:caktux,項目名稱:pytrader,代碼行數:8,代碼來源:pytrader.py

示例4: suspend

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def suspend():
        """
        Suspend curses in order to open another subprocess in the terminal.
        """

        try:
            curses.endwin()
            yield
        finally:
            curses.doupdate() 
開發者ID:tildeclub,項目名稱:ttrv,代碼行數:12,代碼來源:terminal.py

示例5: display

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def display(self, msg=None):
        """
        Redraw the screen, possibly showing a message on the bottom row.
        """
        self.screen.clear()

        width0 = 6*(self.maxx - 10)//10
        width1 = 4*(self.maxx - 10)//10

        showobjs = self.flat[self.top:self.top+self.maxy-1]
        for i, (obj, depth) in enumerate(showobjs):
            text = obj.render()
            style = curses.A_BOLD if i == self.cursor else curses.A_NORMAL
            self.screen.addstr(i, depth*2, text[0][:width0-depth*2], style)
            self.screen.addstr(i, width0+2, text[1][:width1-4])
            self.screen.addstr(i, width0+width1, text[2][:4])
            self.screen.addstr(i, width0+width1+5, text[3][:5])

        if msg is not None:
            self.screen.addstr(self.maxy-1, 0,
                               msg[:self.maxx-1], curses.A_BOLD)
        else:
            self.screen.addstr(self.maxy-1, 0,
                               self.status[:self.maxx-1], curses.A_BOLD)

        self.screen.refresh()
        curses.doupdate() 
開發者ID:chronitis,項目名稱:curseradio,代碼行數:29,代碼來源:curseradio.py

示例6: refresh_chat

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def refresh_chat(self):
        """
        Refresh only the chat box.
        """
        self.chat_container.noutrefresh()
        self.chat_win.noutrefresh()
        curses.doupdate() 
開發者ID:spec-sec,項目名稱:SecureChat,代碼行數:9,代碼來源:cli.py

示例7: refresh_prompt

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def refresh_prompt(self):
        """
        Refresh only the input prompt.
        """
        self.prompt_win.noutrefresh()
        curses.doupdate() 
開發者ID:spec-sec,項目名稱:SecureChat,代碼行數:8,代碼來源:cli.py

示例8: refresh_all

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def refresh_all(self):
        """
        Refresh everything in the interface.
        """
        self.stdscr.noutrefresh()
        self.chat_container.noutrefresh()
        self.chat_win.noutrefresh()
        self.prompt_win.noutrefresh()
        curses.doupdate() 
開發者ID:spec-sec,項目名稱:SecureChat,代碼行數:11,代碼來源:cli.py

示例9: resize

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def resize(self, uis):
        curses.endwin()
        curses.doupdate()

        global mainwin
        mainwin.refresh()
        maxy, maxx = mainwin.getmaxyx()

        for ui in uis:
            ui.resize(maxy, maxx) 
開發者ID:soarpenguin,項目名稱:python-scripts,代碼行數:12,代碼來源:zktop.py

示例10: main

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def main():
    """Test most of the GUI (except lockout processing)

    Initialize and set up screen
    Create windows
    Generate dummy spectrum data
    Update windows with dummy values
    Process keyboard strokes
    """
    # Use the curses.wrapper() to crash cleanly
    # Note the screen object is passed from the wrapper()
    # http://stackoverflow.com/questions/9854511/ppos_ython-curses-dilemma
    # The issue is the debuuger won't work with the wrapper()
    # So enable the next 2 lines and don't pass screen to main()
    screen = curses.initscr()
    curses.start_color()

    # Setup the screen
    setup_screen(screen)

    # Create windows
    specwin = SpectrumWindow(screen)
    chanwin = ChannelWindow(screen)
    lockoutwin = LockoutWindow(screen)
    rxwin = RxWindow(screen)

    while 1:
        # Generate some random spectrum data from -dyanmic_range to 0 dB
        #   then offset_db
        length = 128
        dynamic_range_db = 100
        offset_db = 50
        data = np.power(10, (-dynamic_range_db*np.random.rand(length)/10)\
            + offset_db/10)
        #data = 1E-5*np.ones(length)
        specwin.draw_spectrum(data)

        # Put some dummy values in the channel, lockout, and receiver windows
        chanwin.draw_channels(['144.100', '142.40', '145.00', '144.10',\
        '142.40', '145.00', '144.10', '142.40', '145.00', '144.10', '142.40',\
        '145.00', '142.40', '145.00', '144.10', '142.400', '145.00', '145.00'])
        lockoutwin.draw_channels(['144.100', '142.40', '145.00'])
        rxwin.draw_rx()

        # Update physical screen
        curses.doupdate()

        # Check for keystrokes and process
        keyb = screen.getch()
        specwin.proc_keyb(keyb)
        rxwin.proc_keyb_hard(keyb)
        rxwin.proc_keyb_soft(keyb)

        # Sleep to get about a 10 Hz refresh
        time.sleep(0.1) 
開發者ID:madengr,項目名稱:ham2mon,代碼行數:57,代碼來源:cursesgui.py

示例11: _get_input

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import doupdate [as 別名]
def _get_input(self, wait_tenths):
        # this works around a strange curses bug with window resizing 
        # not being reported correctly with repeated calls to this
        # function without a doupdate call in between
        curses.doupdate() 
        
        key = self._getch(wait_tenths)
        resize = False
        raw = []
        keys = []
        
        while key >= 0:
            raw.append(key)
            if key==KEY_RESIZE: 
                resize = True
            elif key==KEY_MOUSE:
                keys += self._encode_mouse_event()
            else:
                keys.append(key)
            key = self._getch_nodelay()

        processed = []
        
        try:
            while keys:
                run, keys = escape.process_keyqueue(keys, True)
                processed += run
        except escape.MoreInputRequired:
            key = self._getch(self.complete_tenths)
            while key >= 0:
                raw.append(key)
                if key==KEY_RESIZE: 
                    resize = True
                elif key==KEY_MOUSE:
                    keys += self._encode_mouse_event()
                else:
                    keys.append(key)
                key = self._getch_nodelay()
            while keys:
                run, keys = escape.process_keyqueue(keys, False)
                processed += run

        if resize:
            processed.append('window resize')

        return processed, raw 
開發者ID:AnyMesh,項目名稱:anyMesh-Python,代碼行數:48,代碼來源:curses_display.py


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