electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit bc7051372fd80c78a5ac70a5a540ce23bea00ea8
parent 73cb6a8735f3b2b7eeca23406d87b7f90bc159da
Author: ThomasV <thomasv@electrum.org>
Date:   Tue, 12 Dec 2017 16:55:50 +0100

format a few strings with str.format(). fix #3405

Diffstat:
Mgui/qt/installwizard.py | 4++--
Mgui/qt/network_dialog.py | 4++--
Mgui/qt/seed_dialog.py | 4++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py @@ -527,10 +527,10 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard): grid.addWidget(m_label, 1, 0) grid.addWidget(m_edit, 1, 1) def on_m(m): - m_label.setText(_('Require %d signatures')%m) + m_label.setText(_('Require {0} signatures').format(m)) cw.set_m(m) def on_n(n): - n_label.setText(_('From %d cosigners')%n) + n_label.setText(_('From {0} cosigners').format(n)) cw.set_n(n) m_edit.setMaximum(n) n_edit.valueChanged.connect(on_n) diff --git a/gui/qt/network_dialog.py b/gui/qt/network_dialog.py @@ -355,14 +355,14 @@ class NetworkChoiceLayout(object): height_str = "%d "%(self.network.get_local_height()) + _('blocks') self.height_label.setText(height_str) n = len(self.network.get_interfaces()) - status = _("Connected to %d nodes.")%n if n else _("Not connected") + status = _("Connected to {0} nodes.").format(n) if n else _("Not connected") self.status_label.setText(status) chains = self.network.get_blockchains() if len(chains)>1: chain = self.network.blockchain() checkpoint = chain.get_checkpoint() name = chain.get_name() - msg = _('Chain split detected at block %d')%checkpoint + '\n' + msg = _('Chain split detected at block {0}').format(checkpoint) + '\n' msg += (_('You are following branch') if auto_connect else _('Your server is on branch'))+ ' ' + name msg += ' (%d %s)' % (chain.get_branch_size(), _('blocks')) else: diff --git a/gui/qt/seed_dialog.py b/gui/qt/seed_dialog.py @@ -35,7 +35,7 @@ from .qrtextedit import ShowQRTextEdit, ScanQRTextEdit def seed_warning_msg(seed): return ''.join([ "<p>", - _("Please save these %d words on paper (order is important). "), + _("Please save these {0} words on paper (order is important). "), _("This seed will allow you to recover your wallet in case " "of computer failure."), "</p>", @@ -45,7 +45,7 @@ def seed_warning_msg(seed): "<li>" + _("Never type it on a website.") + "</li>", "<li>" + _("Do not store it electronically.") + "</li>", "</ul>" - ]) % len(seed.split()) + ]).format(len(seed.split())) class SeedLayout(QVBoxLayout):