# Show the window
self.start()
- # Return the callbacks
- return ProgressWindowCallbacks(self)
+ return self
def __exit__(self, type, value, traceback):
# Close the window
self.tui.refresh()
-class ProgressWindowCallbacks(object):
- def __init__(self, window):
- self.window = window
-
- def progress(self, value):
- """
- Updates the progressbar value
- """
- self.window.update(value)
-
- def message(self, text):
- """
- Updates the text in the textbox
- """
- self.window.status(text)
-
- def status(self, progress, message):
- if progress:
- self.progress(progress)
-
- if message:
- self.message(message)
-
-
class PasswordWindow(ButtonsWindow):
def __init__(self, *args, **kwargs):
ButtonsWindow.__init__(self, *args, **kwargs)