Skip to content

Commit

Permalink
ui exit_install
Browse files Browse the repository at this point in the history
  • Loading branch information
mouuff committed Jun 16, 2018
1 parent 1f457b0 commit db69869
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions quail/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def install(self):
self._ui.start_install()
self._solutioner.install()
self._installer.register()
if self._ui:
self._ui.exit_install()

def uninstall(self):
self._solutioner.uninstall()
Expand Down
6 changes: 6 additions & 0 deletions quail/ui/ui_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ def start_install(self):
"""
pass

@abstractmethod
def exit_install(self):
"""installer exiting
"""
pass

@abstractmethod
def progress_callback(self, progress):
"""This method will be set in solutioner
Expand Down
7 changes: 5 additions & 2 deletions quail/ui/ui_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@


class UiConsole(UiBase):
def exit_install(self):
input("[*] Installation successful!\nPress enter to quit...")

def progress_callback(self, progress):
sys.stdout.write("%d %% installing ...\r" % progress)
sys.stdout.write(" %d %% installing ...\r" % progress)
sys.stdout.flush()

def start_install(self):
sys.stdout.write("Install started\n")
sys.stdout.write("[*] Installation started\n")
4 changes: 4 additions & 0 deletions quail/ui/ui_tkinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def __init__(self, parent, controller):


class UiTkinter(UiBase, threading.Thread):
def exit_install(self):
# should be called when install is done
pass

def __init__(self):
self._tk = None
self._event_run_install = threading.Event()
Expand Down

0 comments on commit db69869

Please # to comment.