本文整理汇总了Python中armoryengine.BDM.TheBDM.getBDMState方法的典型用法代码示例。如果您正苦于以下问题:Python TheBDM.getBDMState方法的具体用法?Python TheBDM.getBDMState怎么用?Python TheBDM.getBDMState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类armoryengine.BDM.TheBDM
的用法示例。
在下文中一共展示了TheBDM.getBDMState方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupTheBDM
# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getBDMState [as 别名]
def setupTheBDM():
TheBDM.setBlocking(True)
if not TheBDM.isInitialized():
TheBDM.registerWallet(masterWallet)
TheBDM.setOnlineMode(True)
# Only executed on the first call if blockchain not loaded yet.
LOGINFO('Blockchain loading')
while not TheBDM.getBDMState()=='BlockchainReady':
LOGINFO('Blockchain Not Ready Yet %s' % TheBDM.getBDMState())
time.sleep(2)
示例2: createNewWalletFromWizard
# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getBDMState [as 别名]
def createNewWalletFromWizard(self):
self.newWallet = PyBtcWallet().createNewWallet( \
securePassphrase=self.setPassphrasePage.pageFrame.getPassphrase(), \
kdfTargSec=self.walletCreationPage.pageFrame.getKdfSec(), \
kdfMaxMem=self.walletCreationPage.pageFrame.getKdfBytes(), \
shortLabel=self.walletCreationPage.pageFrame.getName(), \
longLabel=self.walletCreationPage.pageFrame.getDescription(), \
doRegisterWithBDM=False, \
extraEntropy=self.main.getExtraEntropyForKeyGen())
self.newWallet.unlock(securePassphrase=
SecureBinaryData(self.setPassphrasePage.pageFrame.getPassphrase()))
# We always want to fill the address pool, right away.
fillPoolProgress = DlgProgress(self, self.main, HBar=1, \
Title="Creating Wallet")
fillPoolProgress.exec_(self.newWallet.fillAddressPool, doRegister=False,
Progress=fillPoolProgress.UpdateHBar)
# Reopening from file helps make sure everything is correct -- don't
# let the user use a wallet that triggers errors on reading it
wltpath = self.newWallet.walletPath
walletFromDisk = PyBtcWallet().readWalletFile(wltpath)
self.main.addWalletToApplication(walletFromDisk, walletIsNew=True)
if TheBDM.getBDMState() in ('Uninitialized', 'Offline'):
TheBDM.registerWallet(walletFromDisk, isFresh=True, wait=False)
else:
self.main.newWalletList.append([walletFromDisk, True])
示例3: updateOnCoinControl
# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getBDMState [as 别名]
def updateOnCoinControl(self):
useAllAddr = (self.altBalance == None)
wlt = self.main.walletMap[self.getSelectedWltID()]
fullBal = wlt.getBalance('Spendable')
if useAllAddr:
self.dispID.setText(wlt.uniqueIDB58)
self.dispName.setText(wlt.labelName)
self.dispDescr.setText(wlt.labelDescr)
if fullBal == 0:
self.dispBal.setText('0.0', color='TextRed', bold=True)
else:
self.dispBal.setValueText(fullBal, wBold=True)
else:
self.dispID.setText(wlt.uniqueIDB58 + '*')
self.dispName.setText(wlt.labelName + '*')
self.dispDescr.setText('*Coin Control Subset*', color='TextBlue', bold=True)
self.dispBal.setText(coin2str(self.altBalance, maxZeros=0), color='TextBlue')
rawValTxt = str(self.dispBal.text())
self.dispBal.setText(rawValTxt + ' <font color="%s">(of %s)</font>' % \
(htmlColor('DisableFG'), coin2str(fullBal, maxZeros=0)))
if not TheBDM.getBDMState() == 'BlockchainReady':
self.dispBal.setText('(available when online)', color='DisableFG')
self.repaint()
if self.coinControlCallback:
self.coinControlCallback(self.sourceAddrList, self.altBalance)
示例4: setUpClass
# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getBDMState [as 别名]
def setUpClass(self):
# This is not a UI so no need to worry about the main thread being blocked.
# Any UI that uses this Daemon can put the call to the Daemon on it's own thread.
TheBDM.setBlocking(True)
TheBDM.setOnlineMode(True)
while not TheBDM.getBDMState()=='BlockchainReady':
time.sleep(2)
示例5: setUpClass
# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getBDMState [as 别名]
def setUpClass(self):
# Handle both calling the this test from the context of the test directory
# and calling this test from the context of the main directory.
# The latter happens if you run all of the tests in the directory
if os.path.exists(TIAB_ZIPFILE_NAME):
tiabZipPath = TIAB_ZIPFILE_NAME
elif os.path.exists(os.path.join('pytest',TIAB_ZIPFILE_NAME)):
tiabZipPath = (os.path.join('pytest',TIAB_ZIPFILE_NAME))
else:
self.fail(NEED_TIAB_MSG)
self.tiab = TiabSession(tiabZipPath=tiabZipPath)
# Need to destroy whatever BDM may have been created automatically
CppBlockUtils.BlockDataManager().DestroyBDM()
newTheBDM()
TheBDM.setDaemon(True)
TheBDM.start()
TheBDM.setSatoshiDir(os.path.join(self.tiab.tiabDirectory,'tiab','1','testnet3'))
self.armoryHomeDir = os.path.join(self.tiab.tiabDirectory,'tiab','armory')
TheBDM.setLevelDBDir(os.path.join(self.tiab.tiabDirectory,'tiab','armory','databases'))
TheBDM.setBlocking(True)
TheBDM.setOnlineMode(wait=True)
i = 0
while not TheBDM.getBDMState()=='BlockchainReady' and i < 10:
time.sleep(2)
i += 1
if i >= 10:
raise RuntimeError("Timeout waiting for TheBDM to get into BlockchainReady state.")
示例6: updateOnWalletChange
# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getBDMState [as 别名]
def updateOnWalletChange(self, ignoredInt=None):
"""
"ignoredInt" is because the signals should call this function with the
selected index of the relevant container, but we grab it again anyway
using getSelectedWltID()
"""
wltID = self.getSelectedWltID()
if len(wltID) > 0:
wlt = self.main.walletMap[wltID]
self.dispID.setText(wltID)
self.dispName.setText(wlt.labelName)
self.dispDescr.setText(wlt.labelDescr)
self.selectedID = wltID
if not TheBDM.getBDMState() == 'BlockchainReady':
self.dispBal.setText('-' * 12)
else:
bal = wlt.getBalance('Spendable')
balStr = coin2str(wlt.getBalance('Spendable'), maxZeros=1)
if bal <= self.balAtLeast:
self.dispBal.setText('<font color="red"><b>%s</b></font>' % balStr)
else:
self.dispBal.setText('<b>' + balStr + '</b>')
if self.selectWltCallback:
self.selectWltCallback(wlt)
self.repaint()
# Reset the coin control variables after a new wallet is selected
if self.coinControlCallback:
self.altBalance = None
self.sourceAddrList = None
self.btnCoinCtrl.setEnabled(wlt.getBalance('Spendable')>0)
self.lblCoinCtrl.setText('Source: All addresses' if wlt.getBalance('Spendable')>0 else\
'Source: 0 addresses' )
self.updateOnCoinControl()
示例7: updateWalletTable
# 需要导入模块: from armoryengine.BDM import TheBDM [as 别名]
# 或者: from armoryengine.BDM.TheBDM import getBDMState [as 别名]
def updateWalletTable(self):
numWallets = len(self.main.walletMap)
self.wltTable.setRowCount(numWallets)
self.wltTable.setColumnCount(4)
row = 0
for wltID,wltObj in self.main.walletMap.iteritems():
wltValueBTC = '(...)'
wltValueUSD = '(...)'
if TheBDM.getBDMState()=='BlockchainReady':
convertVal = float(self.lastSellStr.replace(',',''))
wltBal = wltObj.getBalance('Total')
wltValueBTC = coin2str(wltBal, maxZeros=2)
wltValueUSD = '$' + self.addCommasToPrice('%0.2f' % (wltBal*convertVal/1e8))
rowItems = []
rowItems.append(QTableWidgetItem(wltID))
rowItems.append(QTableWidgetItem(wltObj.labelName))
rowItems.append(QTableWidgetItem(wltValueBTC))
rowItems.append(QTableWidgetItem(wltValueUSD))
rowItems[-2].setTextAlignment(Qt.AlignRight)
rowItems[-1].setTextAlignment(Qt.AlignRight)
rowItems[-2].setFont(GETFONT('Fixed', 10))
rowItems[-1].setFont(GETFONT('Fixed', 10))
for i,item in enumerate(rowItems):
self.wltTable.setItem(row, i, item)
item.setFlags(Qt.NoItemFlags)
self.wltTable.setHorizontalHeaderItem(0, QTableWidgetItem(tr('Wallet ID')))
self.wltTable.setHorizontalHeaderItem(1, QTableWidgetItem(tr('Wallet Name')))
self.wltTable.setHorizontalHeaderItem(2, QTableWidgetItem(tr('BTC Balance')))
self.wltTable.setHorizontalHeaderItem(3, QTableWidgetItem(tr('USD ($) Value')))
self.wltTable.verticalHeader().hide()
row += 1