1
0

wizard: make 'stack' private

This commit is contained in:
SomberNight
2019-02-04 16:51:19 +01:00
parent bc2a421d87
commit 9013f6d59e
4 changed files with 18 additions and 13 deletions

View File

@@ -64,7 +64,7 @@ class BaseWizard(object):
self.plugins = plugins
self.storage = storage
self.wallet = None # type: Abstract_Wallet
self.stack = []
self._stack = []
self.plugin = None
self.keystores = []
self.is_kivy = config.get('gui') == 'kivy'
@@ -76,7 +76,7 @@ class BaseWizard(object):
def run(self, *args):
action = args[0]
args = args[1:]
self.stack.append((action, args))
self._stack.append((action, args))
if not action:
return
if type(action) is tuple:
@@ -91,15 +91,18 @@ class BaseWizard(object):
raise Exception("unknown action", action)
def can_go_back(self):
return len(self.stack)>1
return len(self._stack) > 1
def go_back(self):
if not self.can_go_back():
return
self.stack.pop()
action, args = self.stack.pop()
self._stack.pop()
action, args = self._stack.pop()
self.run(action, *args)
def reset_stack(self):
self._stack = []
def new(self):
name = os.path.basename(self.storage.path)
title = _("Create") + ' ' + name
@@ -476,7 +479,7 @@ class BaseWizard(object):
self.keystores.append(k)
if len(self.keystores) == 1:
xpub = k.get_master_public_key()
self.stack = []
self.reset_stack()
self.run('show_xpub_and_add_cosigners', xpub)
elif len(self.keystores) < self.n:
self.run('choose_keystore')