1
0

Fix docstring display.

This commit is contained in:
Neil Booth
2015-12-12 18:11:07 +09:00
parent 34955bd0f5
commit 36aaad392d
2 changed files with 17 additions and 16 deletions

View File

@@ -2583,11 +2583,14 @@ class ElectrumWindow(QMainWindow, PrintError):
nz.valueChanged.connect(on_nz)
gui_widgets.append((nz_label, nz))
def fmt_docs(key, klass):
lines = [ln.lstrip(" ") for ln in klass.__doc__.split("\n")]
return '\n'.join([key, "", " ".join(lines)])
choosers = sorted(COIN_CHOOSERS.keys())
chooser_name = self.wallet.coin_chooser_name(self.config)
msg = _('Choose coin (UTXO) selection method. The following are available:\n\n')
msg += '\n\n'.join(key + ": " + klass.__doc__
for key, klass in COIN_CHOOSERS.items())
msg += '\n\n'.join(fmt_docs(*item) for item in COIN_CHOOSERS.items())
chooser_label = HelpLabel(_('Coin selection') + ':', msg)
chooser_combo = QComboBox()
chooser_combo.addItems(choosers)