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


Python npyscreen.TitleMultiSelect方法代码示例

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


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

示例1: create

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import TitleMultiSelect [as 别名]
def create(self):

        self.wrends_storage = self.add(npyscreen.TitleMultiSelect, begin_entry_at=30, max_height=len(msg.storages), 
            values=msg.storages, name=msg.DBBackendForm_label, scroll_exit=True)

        self.add(npyscreen.FixedText, value=msg.unselected_storages, rely=len(msg.storages)+4, editable=False, color='STANDOUT') 
开发者ID:GluuFederation,项目名称:community-edition-setup,代码行数:8,代码来源:tui.py

示例2: create

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import TitleMultiSelect [as 别名]
def create(self):
        self.exit_on_cancel = True
        self.opt_form = self.add(
            nps.TitleMultiSelect,
            name='Which Targets do you want to install/modify?',
            values=list(TARGETS.keys())) 
开发者ID:avatartwo,项目名称:avatar2,代码行数:8,代码来源:avatar2_installer.py

示例3: create

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import TitleMultiSelect [as 别名]
def create(self):
        self.bg_skills = self.add(
            npyscreen.TitleText, name="Background:",
            value="", editable=False)
        self.race_skills = self.add(
            npyscreen.TitleText, name="Racial:",
            value="", editable=False)
        self.remaining = self.add(
            npyscreen.TitleText, name="Remaining:",
            value=0, editable=False)
        self.skill_proficiencies = self.add(
            npyscreen.TitleMultiSelect, name="Skill Proficiencies:",
            values=(),
            value_changed_callback=self.update_remaining) 
开发者ID:canismarko,项目名称:dungeon-sheets,代码行数:16,代码来源:create_character.py

示例4: deauth

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import TitleMultiSelect [as 别名]
def deauth(self, args):
        try:
            bssid = self.grid.selected_row()[1]
            assert bssid in self.wifi_instance.bssids.keys(), 'Could not find AP with BSSID: ' + bssid
            if len(self.wifi_instance.bssids[bssid]['clients']) > 0:
                clients_list: List[str] = self.make_client_list(self.wifi_instance.bssids[bssid]['clients'])

                popup_columns: int = len(max(clients_list, key=len)) + len(self.deauth_multi_select_name) + 22
                popup_lines: int = len(clients_list) + 4

                if popup_columns > int(3 * self.x // 4):
                    popup_columns = int(3 * self.x // 4)
                if popup_lines > int(3 * self.y // 4):
                    popup_lines = int(3 * self.y // 4)
                if popup_lines < 6:
                    popup_lines = 6

                popup = npyscreen.Popup(name=self.deauth_popup_name,
                                        columns=popup_columns,
                                        lines=popup_lines)
                deauth_clients = popup.add(npyscreen.TitleMultiSelect, name=self.deauth_multi_select_name,
                                           scroll_exit=True, values=clients_list)
                popup.edit()
                if len(deauth_clients.get_selected_objects()) > 0:
                    if self.wifi_channel != self.wifi_instance.bssids[bssid]['channel']:
                        self.wifi_channel = self.wifi_instance.bssids[bssid]['channel']
                        self.wifi_instance.set_wifi_channel(channel=self.wifi_instance.bssids[bssid]['channel'])
                    for client in deauth_clients.get_selected_objects():
                        self.tm_instance.add_task(self.wifi_instance.send_deauth, bssid, client[0:17], 50)
            else:
                npyscreen.notify_confirm('Not found clients for AP: ' + self.wifi_instance.bssids[bssid]['essid'] +
                                         ' (' + bssid + ')', title="Deauth Error")
                self.parentApp.switchFormPrevious()

        except AssertionError as Error:
            npyscreen.notify_confirm(Error.args[0], title="Assertion Error")
            self.parentApp.switchFormPrevious()

        except IndexError:
            pass

        except TypeError:
            pass 
开发者ID:raw-packet,项目名称:raw-packet,代码行数:45,代码来源:wat.py

示例5: create

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import TitleMultiSelect [as 别名]
def create(self):
        """Create method is called by the Form constructor."""
        self.begin_at = self.parentApp.begin_at
        self.bootproto = self.add(npyscreen.TitleSelectOne,
                                  name=str_ljust("Bootproto"),
                                  begin_entry_at=self.begin_at,
                                  max_height=3,
                                  scroll_exit=True)
        self.teaming = self.add(npyscreen.TitleSelectOne,
                                  name=str_ljust("NIC Teaming"),
                                  begin_entry_at=self.begin_at,
                                  max_height=3,
                                  scroll_exit=True)
        self.interface = self.add(npyscreen.TitleMultiSelect,
                                  name=str_ljust("Interface"),
                                  begin_entry_at=self.begin_at,
                                  #max_height=self.parentApp.calculate_menu_height,
                                  max_height=8,
                                  scroll_exit=True)
        self.ipaddress = self.add(npyscreen.TitleText,
                                  name=str_ljust("IP Address"),
                                  begin_entry_at=self.begin_at)
        self.netmask = self.add(npyscreen.TitleText,
                                name=str_ljust("Netmask"),
                                begin_entry_at=self.begin_at)
        self.dhcp_start = self.add(npyscreen.TitleText,
                                   name=str_ljust("DHCP start"),
                                   begin_entry_at=self.begin_at)
        self.dhcp_end = self.add(npyscreen.TitleText,
                                 name=str_ljust("DHCP end"),
                                 begin_entry_at=self.begin_at)
        self.dns1 = self.add(npyscreen.TitleText,
                             name=str_ljust("Primary DNS"),
                             begin_entry_at=self.begin_at)
        self.dns2 = self.add(npyscreen.TitleText,
                             name=str_ljust("Secondary DNS"),
                             begin_entry_at=self.begin_at)
        self.gateway = self.add(npyscreen.TitleText,
                                name=str_ljust("Gateway"),
                                begin_entry_at=self.begin_at)

        self.dhcp_start.hidden = True
        self.dhcp_end.hidden = True
        self.dns1.hidden = True
        self.dns2.hidden = True
        self.gateway.hidden = True
        self.bootproto.values = ['static', 'dhcp']
        self.teaming.values = ['yes', 'no']
        #self.bootproto.value = 0
        self.bootproto.value_changed_callback = update_bootproto_widget 
开发者ID:sealingtech,项目名称:EDCOP,代码行数:52,代码来源:menu.py


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