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


Python curses.KEY_END属性代码示例

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


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

示例1: testRunUIScrollTallOutputEndHome

# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_END [as 别名]
def testRunUIScrollTallOutputEndHome(self):
    """Scroll tall output with PageDown and PageUp."""

    # Use End and Home to scroll a little before exiting to test scrolling.
    ui = MockCursesUI(
        40,
        80,
        command_sequence=[
            string_to_codes("babble\n"),
            [curses.KEY_END] * 2 + [curses.KEY_HOME] + self._EXIT
        ])

    ui.register_command_handler("babble", self._babble, "")
    ui.run_ui()

    # Screen output/scrolling should have happened exactly once.
    self.assertEqual(4, len(ui.unwrapped_outputs))
    self.assertEqual(4, len(ui.wrapped_outputs))
    self.assertEqual(4, len(ui.scroll_messages))

    # Before scrolling.
    self.assertEqual(["bar"] * 60, ui.unwrapped_outputs[0].lines)
    self.assertEqual(["bar"] * 60, ui.wrapped_outputs[0].lines[:60])

    # Initial scroll: At the top.
    self.assertIn("Scroll (PgDn): 0.00%", ui.scroll_messages[0])

    # After 1st scrolling (End).
    self.assertIn("Scroll (PgUp): 100.00%", ui.scroll_messages[1])

    # After 2nd scrolling (End).
    self.assertIn("Scroll (PgUp): 100.00%", ui.scroll_messages[2])

    # After 3rd scrolling (Hhome).
    self.assertIn("Scroll (PgDn): 0.00%", ui.scroll_messages[3]) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:37,代码来源:curses_ui_test.py

示例2: __init__

# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_END [as 别名]
def __init__(self, block_store, window):
        self._block_store = block_store
        self._window = window

        self._mode = None # TODO debug

        self._browse_height = None

        self._keymap = {
            curses.KEY_DOWN: (self._scroll_down, ),
            curses.KEY_UP: (self._scroll_up, ),

            curses.KEY_HOME: (self._seek, -1000),
            curses.KEY_END: (self._seek, 1000),

            # ord('l'): go_to_latest_block,
            # ord('L'): go_to_latest_block,

            ord('j'): (self._seek, -1),
            ord('J'): (self._seek, -1),

            ord('k'): (self._seek, 1),
            ord('K'): (self._seek, 1),
        }

        self._reset_cursors() 
开发者ID:esotericnonsense,项目名称:bitcoind-ncurses,代码行数:28,代码来源:block_viewer.py

示例3: set_up_handlers

# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_END [as 别名]
def set_up_handlers(self):
        super(Pager, self).set_up_handlers()
        self.handlers = {
            curses.KEY_UP: self.h_scroll_line_up,
            curses.KEY_LEFT: self.h_scroll_line_up,
            curses.KEY_DOWN: self.h_scroll_line_down,
            curses.KEY_RIGHT: self.h_scroll_line_down,
            curses.KEY_NPAGE: self.h_scroll_page_down,
            curses.KEY_PPAGE: self.h_scroll_page_up,
            curses.KEY_HOME: self.h_show_beginning,
            curses.KEY_END: self.h_show_end,
            curses.ascii.NL: self.h_exit,
            curses.ascii.CR: self.h_exit,
            curses.ascii.SP: self.h_scroll_page_down,
            curses.ascii.TAB: self.h_exit,
            ord('j'): self.h_scroll_line_down,
            ord('k'): self.h_scroll_line_up,
            ord('x'): self.h_exit,
            ord('q'): self.h_exit,
            ord('g'): self.h_show_beginning,
            ord('G'): self.h_show_end,
            curses.ascii.ESC: self.h_exit_escape,
        }

        self.complex_handlers = [
        ] 
开发者ID:hexway,项目名称:apple_bleee,代码行数:28,代码来源:wgmultiline.py

示例4: set_up_handlers

# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_END [as 别名]
def set_up_handlers(self):
        super(SimpleGrid, self).set_up_handlers()
        self.handlers = {
                    curses.KEY_UP:      self.h_move_line_up,
                    curses.KEY_LEFT:    self.h_move_cell_left,
                    curses.KEY_DOWN:    self.h_move_line_down,
                    curses.KEY_RIGHT:   self.h_move_cell_right,
                    "k":                self.h_move_line_up,
                    "h":                self.h_move_cell_left,
                    "j":                self.h_move_line_down,
                    "l":                self.h_move_cell_right,
                    curses.KEY_NPAGE:   self.h_move_page_down,
                    curses.KEY_PPAGE:   self.h_move_page_up,
                    curses.KEY_HOME:    self.h_show_beginning,
                    curses.KEY_END:     self.h_show_end,
                    ord('g'):           self.h_show_beginning,
                    ord('G'):           self.h_show_end,
                    curses.ascii.TAB:   self.h_exit,
                    curses.KEY_BTAB:     self.h_exit_up,
                    '^P':               self.h_exit_up,
                    '^N':               self.h_exit_down,
                    #curses.ascii.NL:    self.h_exit,
                    #curses.ascii.SP:    self.h_exit,
                    #ord('x'):       self.h_exit,
                    ord('q'):       self.h_exit,
                    curses.ascii.ESC:   self.h_exit,
                    curses.KEY_MOUSE:    self.h_exit_mouse,
                }

        self.complex_handlers = [
                    ] 
开发者ID:hexway,项目名称:apple_bleee,代码行数:33,代码来源:wggrid.py

示例5: testRunUIScrollTallOutputEndHome

# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_END [as 别名]
def testRunUIScrollTallOutputEndHome(self):
    """Scroll tall output with PageDown and PageUp."""

    # Use End and Home to scroll a little before exiting to test scrolling.
    ui = MockCursesUI(
        40,
        80,
        command_sequence=[
            string_to_codes("babble\n"),
            [curses.KEY_END] * 2 + [curses.KEY_HOME] + self._EXIT
        ])

    ui.register_command_handler("babble", self._babble, "")
    ui.run_ui()

    # Screen output/scrolling should have happened exactly once.
    self.assertEqual(4, len(ui.unwrapped_outputs))
    self.assertEqual(4, len(ui.wrapped_outputs))
    self.assertEqual(4, len(ui.scroll_messages))

    # Before scrolling.
    self.assertEqual(["bar"] * 60, ui.unwrapped_outputs[0].lines)
    self.assertEqual(["bar"] * 60, ui.wrapped_outputs[0].lines[:60])

    # Initial scroll: At the top.
    self.assertIn("Scroll: 0.00%", ui.scroll_messages[0])

    # After 1st scrolling (End).
    self.assertIn("Scroll: 100.00%", ui.scroll_messages[1])

    # After 2nd scrolling (End).
    self.assertIn("Scroll: 100.00%", ui.scroll_messages[2])

    # After 3rd scrolling (Hhome).
    self.assertIn("Scroll: 0.00%", ui.scroll_messages[3]) 
开发者ID:tobegit3hub,项目名称:deep_image_model,代码行数:37,代码来源:curses_ui_test.py

示例6: set_up_handlers

# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_END [as 别名]
def set_up_handlers(self):
        super(Pager, self).set_up_handlers()
        self.handlers = {
                    curses.KEY_UP:      self.h_scroll_line_up,
                    curses.KEY_LEFT:    self.h_scroll_line_up,
                    curses.KEY_DOWN:    self.h_scroll_line_down,
                    curses.KEY_RIGHT:   self.h_scroll_line_down,
                    curses.KEY_NPAGE:   self.h_scroll_page_down,
                    curses.KEY_PPAGE:   self.h_scroll_page_up,
                    curses.KEY_HOME:    self.h_show_beginning,
                    curses.KEY_END:     self.h_show_end,
                    curses.ascii.NL:    self.h_exit,
                    curses.ascii.CR:    self.h_exit,
                    curses.ascii.SP:    self.h_scroll_page_down,
                    curses.ascii.TAB:   self.h_exit,
                    ord('j'):           self.h_scroll_line_down,
                    ord('k'):           self.h_scroll_line_up,
                    ord('x'):           self.h_exit,
                    ord('q'):           self.h_exit,
                    ord('g'):           self.h_show_beginning,
                    ord('G'):           self.h_show_end,
                    curses.ascii.ESC:   self.h_exit_escape,
                }

        self.complex_handlers = [
                    ] 
开发者ID:sealingtech,项目名称:EDCOP,代码行数:28,代码来源:wgmultiline.py

示例7: define_keys

# 需要导入模块: import curses [as 别名]
# 或者: from curses import KEY_END [as 别名]
def define_keys(self):
        self.keys = {'j':   self.down,
                     'k':   self.up,
                     'h':   self.left,
                     'l':   self.right,
                     'J':   self.page_down,
                     'K':   self.page_up,
                     'm':   self.mark,
                     "'":   self.goto_mark,
                     'L':   self.page_right,
                     'H':   self.page_left,
                     'q':   self.quit,
                     'Q':   self.quit,
                     '$':   self.line_end,
                     '^':   self.line_home,
                     '0':   self.line_home,
                     'g':   self.home,
                     'G':   self.goto_row,
                     '|':   self.goto_col,
                     '\n':  self.show_cell,
                     '/':   self.search,
                     'n':   self.search_results,
                     'p':   self.search_results_prev,
                     't':   self.toggle_header,
                     '-':   self.column_gap_down,
                     '+':   self.column_gap_up,
                     '<':   self.column_width_all_down,
                     '>':   self.column_width_all_up,
                     ',':   self.column_width_down,
                     '.':   self.column_width_up,
                     'a':   self.sort_by_column_natural,
                     'A':   self.sort_by_column_natural_reverse,
                     's':   self.sort_by_column,
                     'S':   self.sort_by_column_reverse,
                     'y':   self.yank_cell,
                     'r':   self.reload,
                     'c':   self.toggle_column_width,
                     'C':   self.set_current_column_width,
                     ']':   self.skip_to_row_change,
                     '[':   self.skip_to_row_change_reverse,
                     '}':   self.skip_to_col_change,
                     '{':   self.skip_to_col_change_reverse,
                     '?':   self.help,
                     curses.KEY_F1:     self.help,
                     curses.KEY_UP:     self.up,
                     curses.KEY_DOWN:   self.down,
                     curses.KEY_LEFT:   self.left,
                     curses.KEY_RIGHT:  self.right,
                     curses.KEY_HOME:   self.line_home,
                     curses.KEY_END:    self.line_end,
                     curses.KEY_PPAGE:  self.page_up,
                     curses.KEY_NPAGE:  self.page_down,
                     curses.KEY_IC:     self.mark,
                     curses.KEY_DC:     self.goto_mark,
                     curses.KEY_ENTER:  self.show_cell,
                     KEY_CTRL('a'):  self.line_home,
                     KEY_CTRL('e'):  self.line_end,
                     } 
开发者ID:OpenTrading,项目名称:OpenTrader,代码行数:60,代码来源:tabview.py


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