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


Python curses.KEY_F1屬性代碼示例

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


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

示例1: beforeEditing

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import KEY_F1 [as 別名]
def beforeEditing(self):

        self.parentApp.my_counter = 0

        self.add_handlers({curses.KEY_F1: self.display_help})
        self.add(npyscreen.MultiLineEdit, value='=' * (self.columns - 4), max_height=1, rely=self.lines-4, editable=False)
        self.marketing_label = self.add(npyscreen.MultiLineEdit, value='', max_height=1, rely=self.lines-3, editable=False)

        form_name = getClassName(self)

        if form_name != 'InstallStepsForm':

            next_x = 20 if  form_name == 'MAIN' else 28
            self.button_next = self.add(npyscreen.ButtonPress, name="Next", when_pressed_function=self.nextButtonPressed, rely=self.lines-5, relx=self.columns - next_x)

            if next_x == 28:
                self.button_back = self.add(npyscreen.ButtonPress, name="Back", when_pressed_function=self.backButtonPressed, rely=self.lines-5, relx=self.columns - 20)

        self.button_quit = self.add(npyscreen.ButtonPress, name="Quit", when_pressed_function=self.quitButtonPressed, rely=self.lines-5, relx=self.columns - 12)

        if hasattr(self, 'do_beforeEditing'):
            self.do_beforeEditing() 
開發者ID:GluuFederation,項目名稱:community-edition-setup,代碼行數:24,代碼來源:tui.py

示例2: create

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import KEY_F1 [as 別名]
def create(self):
        self.name = 'Dictionary Browser \xe2\x94\x80\xe2\x94\x80 (Press F1 for help)'
        self.add_handlers({curses.KEY_F1: self.usage,
         ord('/'): self.search,
         ord('f'): self.filter,
         ord('r'): self.reset,
         ord('q'): self.quit})
        self.items = self.add(npyscreen.TitleText, name='Items total', value='0', editable=False)
        self.add(npyscreen.TitleText, name='PS version', value='3010', editable=False)
        self.search_btn = self.add(SearchButton, relx=33, rely=2, name='Search')
        self.search_text = self.add(npyscreen.FixedText, relx=53, rely=2, editable=False)
        self.filter_btn = self.add(FilterButton, relx=33, rely=3, name='Filter')
        self.filter_text = self.add(npyscreen.FixedText, relx=53, rely=3, editable=False)
        self.dict = self.add(Dict, name='Dictionary', scroll_exit=True, max_width=43, relx=2, rely=5, max_height=-2)
        self.perms = self.add(Perms, name='Permissions', scroll_exit=True, rely=5, relx=46, max_height=6)
        self.value = self.add(Value, name='Edit Value', scroll_exit=True, rely=11, relx=46, max_height=-2)
        self.status = self.add(npyscreen.TitleText, name='Status', editable=False, value='Connected to laserjet.lan', rely=-3)
        self.save = self.add(npyscreen.ButtonPress, name='Save Changes', rely=-3, relx=-27)
        self.exit = self.add(npyscreen.ButtonPress, name='Exit', rely=-3, relx=-12)
        self.save.whenPressed = self.commit
        self.exit.whenPressed = self.quit
        self.update_dict() 
開發者ID:RUB-NDS,項目名稱:PRET,代碼行數:24,代碼來源:console.py

示例3: set_up_handlers

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import KEY_F1 [as 別名]
def set_up_handlers(self):
        self.complex_handlers = []
        self.handlers = { 
                    curses.KEY_F1: self.h_display_help,
                    "KEY_F(1)": self.h_display_help,
                    "^O":       self.h_display_help,
                    "^L":       self.h_display,
                    curses.KEY_RESIZE: self._resize,
                    } 
開發者ID:hexway,項目名稱:apple_bleee,代碼行數:11,代碼來源:fmForm.py

示例4: define_keys

# 需要導入模塊: import curses [as 別名]
# 或者: from curses import KEY_F1 [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_F1屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。