本文整理汇总了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')
示例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()))
示例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)
示例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
示例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