本文整理汇总了Python中npyscreen.notify_confirm方法的典型用法代码示例。如果您正苦于以下问题:Python npyscreen.notify_confirm方法的具体用法?Python npyscreen.notify_confirm怎么用?Python npyscreen.notify_confirm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类npyscreen
的用法示例。
在下文中一共展示了npyscreen.notify_confirm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: upd_cell
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def upd_cell(self, argument):
global resolved_devs
cell = self.get_cell_name()
if cell == 'Device':
mac = self.get_mac_val_from_cell()
thread2 = Thread(target=self.get_dev_name, args=(mac,))
# thread2 = Thread(target=self.get_all_dev_names())
thread2.daemon = True
thread2.start()
if cell == 'Phone':
if self.get_phone_val_from_cell() == 'X':
hashinfo = "Phone hash={}, email hash={}, AppleID hash={}, SSID hash={} ({})".format(
hash2phone[self.get_mac_val_from_cell()]['ph_hash'],
hash2phone[self.get_mac_val_from_cell()]['email_hash'],
hash2phone[self.get_mac_val_from_cell()]['appleID_hash'],
hash2phone[self.get_mac_val_from_cell()]['SSID_hash'],
get_dict_val(dictOfss, hash2phone[self.get_mac_val_from_cell()]['SSID_hash']))
table = print_results2(hash2phone[self.get_mac_val_from_cell()]['phone_info'])
rez = "{}\n\n{}".format(hashinfo, table)
npyscreen.notify_confirm(rez, title="Phone number info", wrap=True, wide=True, editw=0)
示例2: association
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def association(self, args):
try:
bssid = self.grid.selected_row()[1]
assert bssid in self.wifi_instance.bssids.keys(), 'Could not find AP with BSSID: ' + bssid
self.tm_instance.add_task(self.wifi_instance.send_association_request, bssid,
self.wifi_instance.bssids[bssid]['essid'], True)
except AssertionError as Error:
npyscreen.notify_confirm(Error.args[0], title="Assertion Error")
self.parentApp.switchFormPrevious()
except IndexError:
pass
except TypeError:
pass
示例3: display_help
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def display_help(self, code_of_key_pressed):
class_name = self.__class__.__name__
if hasattr(msg, class_name+'Help'):
help_text = getattr(msg, class_name+'Help')
else:
help_text = msg.no_help
npyscreen.notify_confirm(help_text, title="Help", wide=True)
示例4: nextButtonPressed
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def nextButtonPressed(self):
if not self.license_confirm.value:
npyscreen.notify_confirm(msg.acknowledge_lisence_ask, title="Info")
return
self.parentApp.switchForm("HostForm")
示例5: do_while_waiting
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def do_while_waiting(self):
if not queue.empty():
data = queue.get()
if data[0] == COMPLETED:
if self.parentApp.installObject.post_messages:
npyscreen.notify_confirm('\n'.join(self.parentApp.installObject.post_messages), title="Post Install Messages", wide=True)
npyscreen.notify_confirm(msg.installation_completed.format(self.parentApp.installObject.hostname), title="Completed")
self.parentApp.do_notify = False
self.parentApp.switchForm(None)
elif data[0] == ERROR:
npyscreen.notify_confirm(msg.installation_error +"\n"+data[2], title="ERROR")
self.parentApp.do_notify = False
self.parentApp.switchForm(None)
self.prgress_percantage.value = data[0]
self.prgress_percantage.update()
self.installing.value = data[2]
self.installing.update()
if self.desc_value != data[1]:
if hasattr(msg, 'installation_description_' + data[1]):
desc = getattr(msg, 'installation_description_' + data[1])
else:
desc = msg.installation_description_gluu
self.description.value = '\n'.join(textwrap.wrap(desc, self.columns - 10))
self.description.update()
self.desc_value = data[1]
示例6: help_info
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def help_info(self, args):
help_string: str = \
'Ctrl-E: Show Wireless access point information\n' + \
'Ctrl-D: Send IEEE 802.11 deauth packets\n' + \
'Ctrl-S: Switch WiFi channel\n' + \
'Ctrl-A: Send IEEE 802.11 association packet\n' + \
'Ctrl-R: Start scanner (switch between WiFi channels)\n' + \
'Ctrl-H: Show help information\n' + \
'Ctrl-C: Exit\n'
npyscreen.notify_confirm(help_string, title='Help')
self.parentApp.switchFormPrevious()
示例7: ap_info
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def ap_info(self, args):
try:
npyscreen.notify_confirm(self.get_ap_info(self.grid.selected_row()[1]), title="AP information")
self.parentApp.switchFormPrevious()
except IndexError:
pass
示例8: on_ok
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def on_ok(self):
""" Perform restoration on the backup file selected """
if self.dir_select.value:
npyscreen.notify_wait('In the process of restoring',
title='Restoring...')
status = self.restore(self.dirs[self.dir_select.value[0]])
if status[0]:
npyscreen.notify_confirm('Status of restore:\n' +
status[1])
else:
npyscreen.notify_confirm(status[1])
self.quit()
else:
npyscreen.notify_confirm('Choose a version to restore from')
示例9: quit
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def quit(self, *args, **kargs):
""" Quit without making any changes to the tool """
npyscreen.notify_confirm('No changes made to instance(s)',
title='Instance confiugration cancelled')
self.change_screens()
示例10: on_cancel
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def on_cancel(self):
""" Don't save changes made to vent.template """
npyscreen.notify_confirm('No changes made to ' +
self.settings['tool_name'],
title='Configurations not saved')
self.change_screens()
示例11: h_help
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def h_help(self, char):
npyscreen.notify_confirm(self.helpmsg, title=self.prev_field, editw=1)
示例12: prompt
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def prompt(self):
state = self.parentApp.state
self.parentApp.setNextForm('LINK')
npyscreen.notify_confirm("Couldn't open your signal config file for:\nPhone: {}\nConfig dir: {}".format(state.phone, state.configDir) +
"\nDo you want to link a new device right now? Hit enter twice to select the OK button. To cancel, press Ctrl+C", title="No signal-cli config")
示例13: getQR
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def getQR(self):
if not self.parentApp.setup.showingToken:
return
while self.parentApp.setup.token is None:
npyscreen.notify_wait(
"Waiting for token...\n\nOpen Signal > Settings > Linked Devices > Add and scan the QR code.", title="Setup")
time.sleep(0.1)
if not self.parentApp.setup.token.startswith('tsdevice:'):
npyscreen.notify_confirm(
"There was not a valid registration token returned from signal-cli\n\nReturned token: {}".format(self.parentApp.setup.token), title="Setup")
exit(0)
return pyqrcode.create(self.parentApp.setup.token, error='L').terminal(quiet_zone=1)
示例14: showQR
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def showQR(self):
state = self.parentApp.state
self.parentApp.setup.showingToken = True
self.parentApp.tokenQR = self.getQR()
self.parentApp.setup.showingToken = False
npyscreen.blank_terminal()
print("\r")
for line in self.parentApp.tokenQR.splitlines():
print(line)
print("\r", end='')
print("")
print("Open Signal > Settings > Linked Devices > Add and scan the QR code.\r")
npyscreen.notify_confirm(
self.getResponse(), title="Restart signal-curses to begin chatting")
exit(0)
示例15: afterEditing
# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import notify_confirm [as 别名]
def afterEditing(self):
log(self.tree.value)
selected, is_group = self.getFromId(self.tree.value)
log(selected)
if not selected:
npyscreen.notify_confirm(
'Invalid entry', title='Select User/Group')
return
self.parentApp.app.wMain.clearValues()
self.parentApp.app.wMain.update()
self.parentApp.updateState(selected, is_group)
self.parentApp.setNextForm('APP')