import re import sys import threading from PyQt4.QtGui import * from PyQt4.QtCore import * import PyQt4.QtCore as QtCore import electrum from electrum.i18n import _ from electrum import Wallet from electrum import bitcoin from electrum import util import seed_dialog from network_dialog import NetworkDialog from util import * from electrum.plugins import always_hook, run_hook from electrum.mnemonic import prepare_seed MSG_ENTER_ANYTHING = _("Please enter a seed phrase, a master key, a list of Bitcoin addresses, or a list of private keys") MSG_SHOW_MPK = _("Here is your master public key") MSG_ENTER_MPK = _("Please enter your master public key") MSG_ENTER_SEED_OR_MPK = _("Please enter a seed phrase or a master key (xpub or xprv)") MSG_VERIFY_SEED = _("Your seed is important!") + "\n" + _("To make sure that you have properly saved your seed, please retype it here.") class CosignWidget(QWidget): size = 120 def __init__(self, m, n): QWidget.__init__(self) self.R = QRect(0, 0, self.size, self.size) self.setGeometry(self.R) self.m = m self.n = n def set_n(self, n): self.n = n self.update() def set_m(self, m): self.m = m self.update() def paintEvent(self, event): import math bgcolor = self.palette().color(QPalette.Background) pen = QPen(bgcolor, 7, QtCore.Qt.SolidLine) qp = QPainter() qp.begin(self) qp.setPen(pen) qp.setRenderHint(QPainter.Antialiasing) qp.setBrush(Qt.gray) for i in range(self.n): alpha = int(16* 360 * i/self.n) alpha2 = int(16* 360 * 1/self.n) qp.setBrush(Qt.green if i