1
0

misc python3 updates:

- use jsonrpclib-pelix
 - update the kivy gui
 - update plugins
This commit is contained in:
ThomasV
2017-02-16 10:54:24 +01:00
parent e562b0b565
commit c3388d9677
32 changed files with 130 additions and 129 deletions

View File

@@ -46,6 +46,7 @@ class ChoiceDialog(Factory.Popup):
def __init__(self, title, choices, key, callback):
Factory.Popup.__init__(self)
print(choices, type(choices))
if type(choices) is list:
choices = dict(map(lambda x: (x,x), choices))
layout = self.ids.choices

View File

@@ -14,15 +14,14 @@ from kivy.core.window import Window
from kivy.clock import Clock
from kivy.utils import platform
from electrum_gui.kivy.uix.dialogs import EventsDialog
from electrum_gui.kivy.i18n import _
from electrum.base_wizard import BaseWizard
from password_dialog import PasswordDialog
from . import EventsDialog
from ...i18n import _
from .password_dialog import PasswordDialog
# global Variables
app = App.get_running_app()
is_test = (platform == "linux")
test_seed = "time taxi field recycle tiny license olive virus report rare steel portion achieve"
test_xpub = "xpub661MyMwAqRbcEbvVtRRSjqxVnaWVUMewVzMiURAKyYratih4TtBpMypzzefmv8zUNebmNVzB3PojdC5sV2P9bDgMoo9B3SARw1MXUUfU1GL"
@@ -429,7 +428,7 @@ class WizardDialog(EventsDialog):
crcontent = ObjectProperty(None)
def __init__(self, wizard, **kwargs):
super(WizardDialog, self).__init__(**kwargs)
super(WizardDialog, self).__init__()
self.wizard = wizard
self.ids.back.disabled = not wizard.can_go_back()
self.app = App.get_running_app()
@@ -624,9 +623,7 @@ class RestoreSeedDialog(WizardDialog):
def get_text(self):
ti = self.ids.text_input_seed
text = unicode(ti.text).strip()
text = ' '.join(text.split())
return text
return ' '.join(ti.text.strip().split())
def update_text(self, c):
c = c.lower()
@@ -752,6 +749,7 @@ class InstallWizard(BaseWizard, Widget):
# on completion hide message
Clock.schedule_once(lambda dt: app.info_bubble.hide(now=True), -1)
app = App.get_running_app()
app.show_info_bubble(
text=msg, icon='atlas://gui/kivy/theming/light/important',
pos=Window.center, width='200sp', arrow_pos=None, modal=True)
@@ -793,6 +791,7 @@ class InstallWizard(BaseWizard, Widget):
def show_xpub_dialog(self, **kwargs): ShowXpubDialog(self, **kwargs).open()
def show_error(self, msg):
app = App.get_running_app()
Clock.schedule_once(lambda dt: app.show_error(msg))
def password_dialog(self, message, callback):

View File

@@ -10,7 +10,7 @@ from electrum.plugins import run_hook
from electrum import coinchooser
from electrum.util import fee_levels
from choice_dialog import ChoiceDialog
from .choice_dialog import ChoiceDialog
Builder.load_string('''
#:import partial functools.partial

View File

@@ -1,13 +1,14 @@
import os
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from electrum_gui.kivy.i18n import _
from electrum.util import base_units
import os
from label_dialog import LabelDialog
from ...i18n import _
from .label_dialog import LabelDialog
Builder.load_string('''
#:import os os

View File

@@ -104,7 +104,7 @@ class QRCodeWidget(FloatLayout):
for c in range(k):
bext([0, 0, 0] if matrix[k-1-r][c] else [cr, cg, cb])
# then blit the buffer
buff = ''.join(map(chr, buff))
buff = bytes(buff)
# update texture
self._upd_texture(buff)

View File

@@ -22,7 +22,7 @@ from electrum import bitcoin
from electrum.util import timestamp_to_datetime
from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED
from context_menu import ContextMenu
from .context_menu import ContextMenu
from electrum_gui.kivy.i18n import _
@@ -235,7 +235,7 @@ class SendScreen(CScreen):
self.payment_request = None
def do_paste(self):
contents = unicode(self.app._clipboard.paste())
contents = self.app._clipboard.paste()
if not contents:
self.app.show_info(_("Clipboard is empty"))
return
@@ -261,7 +261,7 @@ class SendScreen(CScreen):
self.app.show_error(_('Invalid amount') + ':\n' + self.screen.amount)
return
outputs = [(bitcoin.TYPE_ADDRESS, address, amount)]
message = unicode(self.screen.message)
message = self.screen.message
amount = sum(map(lambda x:x[2], outputs))
if self.app.electrum_config.get('use_rbf'):
from dialogs.question import Question
@@ -344,7 +344,7 @@ class ReceiveScreen(CScreen):
req = self.app.wallet.get_payment_request(addr, self.app.electrum_config)
self.screen.status = ''
if req:
self.screen.message = unicode(req.get('memo', ''))
self.screen.message = req.get('memo', '')
amount = req.get('amount')
self.screen.amount = self.app.format_amount_and_units(amount) if amount else ''
status = req.get('status', PR_UNKNOWN)
@@ -376,9 +376,9 @@ class ReceiveScreen(CScreen):
self.app.show_info(_('Request copied to clipboard'))
def save_request(self):
addr = str(self.screen.address)
amount = str(self.screen.amount)
message = unicode(self.screen.message)
addr = self.screen.address
amount = self.screen.amount
message = self.screen.message
amount = self.app.get_amount(amount) if amount else 0
req = self.app.wallet.make_payment_request(addr, amount, message, None)
self.app.wallet.add_payment_request(req, self.app.electrum_config)

View File

@@ -1,8 +1,8 @@
#:import _ electrum_gui.kivy.i18n._
#:import Factory kivy.factory.Factory
#:set font_light 'gui/kivy/data/fonts/Roboto-Condensed.ttf'
#:set btc_symbol unichr(171)
#:set mbtc_symbol unichr(187)
#:set btc_symbol chr(171)
#:set mbtc_symbol chr(187)

View File

@@ -1,7 +1,7 @@
#:import _ electrum_gui.kivy.i18n._
#:import Decimal decimal.Decimal
#:set btc_symbol unichr(171)
#:set mbtc_symbol unichr(187)
#:set btc_symbol chr(171)
#:set mbtc_symbol chr(187)
#:set font_light 'gui/kivy/data/fonts/Roboto-Condensed.ttf'

View File

@@ -1,7 +1,7 @@
#:import _ electrum_gui.kivy.i18n._
#:import Decimal decimal.Decimal
#:set btc_symbol unichr(171)
#:set mbtc_symbol unichr(187)
#:set btc_symbol chr(171)
#:set mbtc_symbol chr(187)
#:set font_light 'gui/kivy/data/fonts/Roboto-Condensed.ttf'