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


Python npyscreen.notify_confirm方法代碼示例

本文整理匯總了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) 
開發者ID:hexway,項目名稱:apple_bleee,代碼行數:22,代碼來源:ble_read_state.py

示例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 
開發者ID:raw-packet,項目名稱:raw-packet,代碼行數:18,代碼來源:wat.py

示例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) 
開發者ID:GluuFederation,項目名稱:community-edition-setup,代碼行數:11,代碼來源:tui.py

示例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") 
開發者ID:GluuFederation,項目名稱:community-edition-setup,代碼行數:9,代碼來源:tui.py

示例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] 
開發者ID:GluuFederation,項目名稱:community-edition-setup,代碼行數:32,代碼來源:tui.py

示例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() 
開發者ID:raw-packet,項目名稱:raw-packet,代碼行數:13,代碼來源:wat.py

示例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 
開發者ID:raw-packet,項目名稱:raw-packet,代碼行數:8,代碼來源:wat.py

示例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') 
開發者ID:CyberReboot,項目名稱:vent,代碼行數:16,代碼來源:backup.py

示例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() 
開發者ID:CyberReboot,項目名稱:vent,代碼行數:7,代碼來源:del_instances.py

示例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() 
開發者ID:CyberReboot,項目名稱:vent,代碼行數:8,代碼來源:editor.py

示例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) 
開發者ID:IBM,項目名稱:power-up,代碼行數:4,代碼來源:osinstall.py

示例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") 
開發者ID:jwoglom,項目名稱:signal-curses,代碼行數:7,代碼來源:forms.py

示例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) 
開發者ID:jwoglom,項目名稱:signal-curses,代碼行數:14,代碼來源:forms.py

示例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) 
開發者ID:jwoglom,項目名稱:signal-curses,代碼行數:17,代碼來源:forms.py

示例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') 
開發者ID:jwoglom,項目名稱:signal-curses,代碼行數:15,代碼來源:__init__.py


注:本文中的npyscreen.notify_confirm方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。