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


Python StartBTChipPersoDialog.exec_方法代码示例

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


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

示例1: get_client

# 需要导入模块: from btchip.btchipPersoWizard import StartBTChipPersoDialog [as 别名]
# 或者: from btchip.btchipPersoWizard.StartBTChipPersoDialog import exec_ [as 别名]
    def get_client(self, noPin=False):
        if not BTCHIP:
            give_error('please install github.com/btchip/btchip-python')

        aborted = False
        if not self.client or self.client.bad:
            try:
                d = getDongle(BTCHIP_DEBUG)
                d.setWaitImpl(DongleWaitQT(d))
                self.client = btchip(d)
                firmware = self.client.getFirmwareVersion()['version'].split(".")
                if int(firmware[0]) <> 1 or int(firmware[1]) <> 4:
                    aborted = True
                    raise Exception("Unsupported firmware version")
                if int(firmware[2]) < 9:
                    aborted = True
                    raise Exception("Please update your firmware - 1.4.9 or higher is necessary")
                try:
                    self.client.getOperationMode()
                except BTChipException, e:
                    if (e.sw == 0x6985):
                        d.close()
                        dialog = StartBTChipPersoDialog()                        
                        dialog.exec_()
                        # Then fetch the reference again  as it was invalidated
                        d = getDongle(BTCHIP_DEBUG)
                        d.setWaitImpl(DongleWaitQT(d))
                        self.client = btchip(d)
                    else:
                        raise e
                if not noPin:                    
                    # Immediately prompts for the PIN
                    remaining_attempts = self.client.getVerifyPinRemainingAttempts()                    
                    if remaining_attempts <> 1:
                        msg = "Enter your BTChip PIN - remaining attempts : " + str(remaining_attempts)
                    else:
                        msg = "Enter your BTChip PIN - WARNING : LAST ATTEMPT. If the PIN is not correct, the dongle will be wiped."
                    confirmed, p, pin = self.password_dialog(msg)                
                    if not confirmed:
                        aborted = True
                        raise Exception('Aborted by user - please unplug the dongle and plug it again before retrying')
                    pin = pin.encode()                   
                    self.client.verifyPin(pin)

            except BTChipException, e:
                try:
                    self.client.dongle.close()
                except:
                    pass
                self.client = None                
                if (e.sw == 0x6faa):
                    raise Exception("Dongle is temporarily locked - please unplug it and replug it again")                    
                if ((e.sw & 0xFFF0) == 0x63c0):
                    raise Exception("Invalid PIN - please unplug the dongle and plug it again before retrying")
                raise e
开发者ID:azhar3339,项目名称:electrum,代码行数:57,代码来源:btchipwallet.py

示例2: get_client

# 需要导入模块: from btchip.btchipPersoWizard import StartBTChipPersoDialog [as 别名]
# 或者: from btchip.btchipPersoWizard.StartBTChipPersoDialog import exec_ [as 别名]
    def get_client(self, noPin=False):
        if not BTCHIP:
            self.give_error('please install github.com/btchip/btchip-python')

        aborted = False
        if not self.client or self.client.bad:
            try:
                d = getDongle(BTCHIP_DEBUG)
                d.setWaitImpl(DongleWaitQT(d))
                self.client = btchip(d)
                ver = self.client.getFirmwareVersion()
                firmware = ver['version'].split(".")
                self.canAlternateCoinVersions = (ver['specialVersion'] >= 0x20 and
                                                 map(int, firmware) >= [1, 0, 1])
                if not checkFirmware(firmware):                    
                    d.close()
                    try:
                        updateFirmware()
                    except Exception, e:
                        aborted = True
                        raise e
                    d = getDongle(BTCHIP_DEBUG)
                    d.setWaitImpl(DongleWaitQT(d))
                    self.client = btchip(d)                    
                try:
                    self.client.getOperationMode()
                except BTChipException, e:
                    if (e.sw == 0x6985):
                        d.close()
                        dialog = StartBTChipPersoDialog()                        
                        dialog.exec_()
                        # Then fetch the reference again  as it was invalidated
                        d = getDongle(BTCHIP_DEBUG)
                        d.setWaitImpl(DongleWaitQT(d))
                        self.client = btchip(d)
                    else:
                        raise e
                if not noPin:                    
                    # Immediately prompts for the PIN
                    remaining_attempts = self.client.getVerifyPinRemainingAttempts()                    
                    if remaining_attempts <> 1:
                        msg = "Enter your BTChip PIN - remaining attempts : " + str(remaining_attempts)
                    else:
                        msg = "Enter your BTChip PIN - WARNING : LAST ATTEMPT. If the PIN is not correct, the dongle will be wiped."
                    confirmed, p, pin = self.password_dialog(msg)                
                    if not confirmed:
                        aborted = True
                        raise Exception('Aborted by user - please unplug the dongle and plug it again before retrying')
                    pin = pin.encode()                   
                    self.client.verifyPin(pin)
                    if self.canAlternateCoinVersions:
                        self.client.setAlternateCoinVersions(48, 5)
开发者ID:Geopay,项目名称:electrum-pkb,代码行数:54,代码来源:btchipwallet.py

示例3: get_client

# 需要导入模块: from btchip.btchipPersoWizard import StartBTChipPersoDialog [as 别名]
# 或者: from btchip.btchipPersoWizard.StartBTChipPersoDialog import exec_ [as 别名]
    def get_client(self, noPin=False):
        if not BTCHIP:
            self.give_error("please install github.com/btchip/btchip-python")

        aborted = False
        if not self.client or self.client.bad:
            try:
                d = getDongle(BTCHIP_DEBUG)
                self.client = btchip(d)
                self.client.handler = self.plugin.handler
                firmware = self.client.getFirmwareVersion()["version"].split(".")
                if not checkFirmware(firmware):
                    d.close()
                    try:
                        updateFirmware()
                    except Exception, e:
                        aborted = True
                        raise e
                    d = getDongle(BTCHIP_DEBUG)
                    self.client = btchip(d)
                try:
                    self.client.getOperationMode()
                except BTChipException, e:
                    if e.sw == 0x6985:
                        d.close()
                        dialog = StartBTChipPersoDialog()
                        dialog.exec_()
                        # Then fetch the reference again  as it was invalidated
                        d = getDongle(BTCHIP_DEBUG)
                        self.client = btchip(d)
                    else:
                        raise e
                if not noPin:
                    # Immediately prompts for the PIN
                    remaining_attempts = self.client.getVerifyPinRemainingAttempts()
                    if remaining_attempts <> 1:
                        msg = "Enter your BTChip PIN - remaining attempts : " + str(remaining_attempts)
                    else:
                        msg = "Enter your BTChip PIN - WARNING : LAST ATTEMPT. If the PIN is not correct, the dongle will be wiped."
                    confirmed, p, pin = self.password_dialog(msg)
                    if not confirmed:
                        aborted = True
                        raise Exception("Aborted by user - please unplug the dongle and plug it again before retrying")
                    pin = pin.encode()
                    self.client.verifyPin(pin)
开发者ID:nmarley,项目名称:electrum-dash,代码行数:47,代码来源:btchipwallet.py

示例4: get_client

# 需要导入模块: from btchip.btchipPersoWizard import StartBTChipPersoDialog [as 别名]
# 或者: from btchip.btchipPersoWizard.StartBTChipPersoDialog import exec_ [as 别名]
 def get_client(self, wallet, noPin=False):
     aborted = False
     client = self.client
     if not client or client.bad:
         try:
             d = getDongle(BTCHIP_DEBUG)
             client = btchip(d)
             firmware = client.getFirmwareVersion()['version'].split(".")
             if not checkFirmware(firmware):
                 d.close()
                 try:
                     updateFirmware()
                 except Exception, e:
                     aborted = True
                     raise e
                 d = getDongle(BTCHIP_DEBUG)
                 client = btchip(d)
             try:
                 client.getOperationMode()
             except BTChipException, e:
                 if (e.sw == 0x6985):
                     d.close()
                     dialog = StartBTChipPersoDialog()
                     dialog.exec_()
                     # Then fetch the reference again  as it was invalidated
                     d = getDongle(BTCHIP_DEBUG)
                     client = btchip(d)
                 else:
                     raise e
             if not noPin:
                 # Immediately prompts for the PIN
                 remaining_attempts = client.getVerifyPinRemainingAttempts()
                 if remaining_attempts <> 1:
                     msg = "Enter your Ledger PIN - remaining attempts : " + str(remaining_attempts)
                 else:
                     msg = "Enter your Ledger PIN - WARNING : LAST ATTEMPT. If the PIN is not correct, the dongle will be wiped."
                 confirmed, p, pin = wallet.password_dialog(msg)
                 if not confirmed:
                     aborted = True
                     raise Exception('Aborted by user - please unplug the dongle and plug it again before retrying')
                 pin = pin.encode()
                 client.verifyPin(pin)
开发者ID:DaveA50,项目名称:lbryum,代码行数:44,代码来源:ledger.py

示例5: setup_dialog

# 需要导入模块: from btchip.btchipPersoWizard import StartBTChipPersoDialog [as 别名]
# 或者: from btchip.btchipPersoWizard.StartBTChipPersoDialog import exec_ [as 别名]
 def setup_dialog(self):
     dialog = StartBTChipPersoDialog()
     dialog.exec_()
开发者ID:Matoking,项目名称:electrum,代码行数:5,代码来源:qt.py


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