Remove usages of deprecated apply() builtin
This commit is contained in:
@@ -841,7 +841,7 @@ class ElectrumWindow(App):
|
||||
if self.wallet.has_password():
|
||||
self.password_dialog(msg, f, args)
|
||||
else:
|
||||
apply(f, args + (None,))
|
||||
f(*args, None)
|
||||
|
||||
def delete_wallet(self):
|
||||
from uix.dialogs.question import Question
|
||||
@@ -918,7 +918,7 @@ class ElectrumWindow(App):
|
||||
|
||||
def password_dialog(self, msg, f, args):
|
||||
def callback(pw):
|
||||
Clock.schedule_once(lambda x: apply(f, args + (pw,)), 0.1)
|
||||
Clock.schedule_once(lambda _: f(*args, pw), 0.1)
|
||||
if self._password_dialog is None:
|
||||
from uix.dialogs.password_dialog import PasswordDialog
|
||||
self._password_dialog = PasswordDialog()
|
||||
|
||||
@@ -767,7 +767,7 @@ class InstallWizard(BaseWizard, Widget):
|
||||
WizardChoiceDialog(self, **kwargs).open()
|
||||
else:
|
||||
f = kwargs['run_next']
|
||||
apply(f, (choices[0][0],))
|
||||
f(choices[0][0])
|
||||
|
||||
def multisig_dialog(self, **kwargs): WizardMultisigDialog(self, **kwargs).open()
|
||||
def show_seed_dialog(self, **kwargs): ShowSeedDialog(self, **kwargs).open()
|
||||
|
||||
@@ -87,7 +87,7 @@ def wizard_dialog(func):
|
||||
# out = ()
|
||||
if type(out) is not tuple:
|
||||
out = (out,)
|
||||
apply(run_next, out)
|
||||
run_next(*out)
|
||||
return func_wrapper
|
||||
|
||||
|
||||
|
||||
@@ -1708,7 +1708,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||
c = commands.Commands(self.config, self.wallet, self.network, lambda: self.console.set_json(True))
|
||||
methods = {}
|
||||
def mkfunc(f, method):
|
||||
return lambda *args: apply( f, (method, args, self.password_dialog ))
|
||||
return lambda *args: f(method, args, self.password_dialog)
|
||||
for m in dir(c):
|
||||
if m[0]=='_' or m in ['network','wallet']: continue
|
||||
methods[m] = mkfunc(c._run, m)
|
||||
|
||||
@@ -69,7 +69,7 @@ class EnterButton(QPushButton):
|
||||
|
||||
def keyPressEvent(self, e):
|
||||
if e.key() == Qt.Key_Return:
|
||||
apply(self.func,())
|
||||
self.func()
|
||||
|
||||
|
||||
class ThreadedButton(QPushButton):
|
||||
|
||||
Reference in New Issue
Block a user