You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

446 lines
17 KiB

3 years ago
3 years ago
Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Remove artifact from squashing Amend artifacts Handle no progress and tidy up footer label
4 years ago
3 years ago
Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Remove artifact from squashing Amend artifacts Handle no progress and tidy up footer label
4 years ago
Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Remove artifact from squashing Amend artifacts Handle no progress and tidy up footer label
4 years ago
Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Remove artifact from squashing Amend artifacts Handle no progress and tidy up footer label
4 years ago
Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Jack McKew <jackmckew2@gmail.com> 1594344614 +1000 committer Jack McKew <jackmckew2@gmail.com> 1594346638 +1000 Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Integration test - missing on complete tests Remove old code Elapsed / Remaining Time on Progress Bar parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246420 +1000 parent 00e0f3e7c6434240ffe02522a0be2daf8c5b456c author Fizban <jackmckew2@gmail.com> 1593182730 +1000 committer Fizban <jackmckew2@gmail.com> 1593246359 +1000 Elapsed / Remaining Time on Progress Bar Elapsed / Remaining Time on Progress Bar Time Remaining Text for Progress Time remaining somewhat working Time format working Add tests and pythn 2.7 compat Incase python 2 import perf counter in func Fix flickering text and align Remove transactUI Add new decorators Update time remaining notes in README Amend tests with new arguments Remove unused import Separate into time module Move to dictionary structure options Explicitly show time text Amend tests for separate module Remove old code Pass testdata as dict instead of kwargs Merge dictionaries for defaults Test almost working Delete settings.json Revert "Test almost working" This reverts commit f17d50681cae664719f67a7e8cc0b1feaf1ac4c7. Back to working state Remove unhelpful test Update docs Working without updated test Add tests for time remaining text Remove artifact from squashing Amend artifacts Handle no progress and tidy up footer label
4 years ago
  1. """
  2. Primary orchestration and control point for Gooey.
  3. """
  4. import queue
  5. import sys
  6. import threading
  7. from contextlib import contextmanager
  8. from functools import wraps
  9. from json import JSONDecodeError
  10. from pprint import pprint
  11. from subprocess import CalledProcessError
  12. from threading import Thread, get_ident
  13. from typing import Mapping, Dict, Type, Iterable
  14. import six
  15. import wx # type: ignore
  16. from gooey.gui.state import FullGooeyState
  17. from gooey.python_bindings.types import PublicGooeyState
  18. from rewx.widgets import set_basic_props
  19. from gooey.gui.components.mouse import notifyMouseEvent
  20. from gooey.gui.state import initial_state, present_time, form_page, ProgressEvent, TimingEvent
  21. from gooey.gui import state as s
  22. from gooey.gui.three_to_four import Constants
  23. from rewx.core import Component, Ref, updatewx, patch
  24. from typing_extensions import TypedDict
  25. from rewx import wsx, render, create_element, mount, update
  26. from rewx import components as c
  27. from wx.adv import TaskBarIcon # type: ignore
  28. import signal
  29. from gooey import Events
  30. from gooey.gui import cli
  31. from gooey.gui import events
  32. from gooey.gui import seeder
  33. from gooey.gui.components import modals
  34. from gooey.gui.components.config import ConfigPage, TabbedConfigPage
  35. from gooey.gui.components.console import Console
  36. from gooey.gui.components.footer import Footer
  37. from gooey.gui.components.header import FrameHeader
  38. from gooey.gui.components.menubar import MenuBar
  39. from gooey.gui.components.sidebar import Sidebar
  40. from gooey.gui.components.tabbar import Tabbar
  41. from gooey.gui.lang.i18n import _
  42. from gooey.gui.processor import ProcessController
  43. from gooey.gui.util.time import Timing
  44. from gooey.gui.pubsub import pub
  45. from gooey.gui.util import wx_util
  46. from gooey.gui.util.wx_util import transactUI
  47. from gooey.python_bindings import constants
  48. from gooey.python_bindings.types import Failure, Success, CommandDetails, Try
  49. from gooey.util.functional import merge, associn, assoc
  50. from gooey.gui.image_repository import loadImages
  51. from gooey.gui import host
  52. from threading import Lock
  53. from gooey.util.functional import associnMany
  54. lock = Lock()
  55. class GooeyApplication(wx.Frame):
  56. """
  57. Main window for Gooey.
  58. """
  59. def __init__(self, buildSpec, *args, **kwargs):
  60. super(GooeyApplication, self).__init__(None, *args, **kwargs)
  61. self._state = {}
  62. self.buildSpec = buildSpec
  63. self.applyConfiguration()
  64. self.menu = MenuBar(buildSpec)
  65. self.SetMenuBar(self.menu)
  66. self.header = FrameHeader(self, buildSpec)
  67. self.configs = self.buildConfigPanels(self)
  68. self.navbar = self.buildNavigation()
  69. self.footer = Footer(self, buildSpec)
  70. self.console = Console(self, buildSpec)
  71. self.props = {
  72. 'background_color': self.buildSpec['header_bg_color'],
  73. 'title': self.buildSpec['program_name'],
  74. 'subtitle': self.buildSpec['program_description'],
  75. 'height': self.buildSpec['header_height'],
  76. 'image_uri': self.buildSpec['images']['configIcon'],
  77. 'image_size': (six.MAXSIZE, self.buildSpec['header_height'] - 10)}
  78. state = form_page(initial_state(self.buildSpec))
  79. self.fprops = {
  80. 'buttons': state['buttons'],
  81. 'progress': state['progress'],
  82. 'timing': state['timing'],
  83. 'bg_color': self.buildSpec['footer_bg_color']
  84. }
  85. # self.hhh = render(create_element(RHeader, self.props), self)
  86. # self.fff = render(create_element(RFooter, self.fprops), self)
  87. # patch(self.hhh, create_element(RHeader, {**self.props, 'image_uri': self.buildSpec['images']['runningIcon']}))
  88. self.layoutComponent()
  89. self.timer = Timing(self)
  90. self.clientRunner = ProcessController(
  91. self.buildSpec.get('progress_regex'),
  92. self.buildSpec.get('progress_expr'),
  93. self.buildSpec.get('hide_progress_msg'),
  94. self.buildSpec.get('encoding'),
  95. self.buildSpec.get('requires_shell'),
  96. self.buildSpec.get('shutdown_signal', signal.SIGTERM)
  97. )
  98. pub.subscribe(events.WINDOW_START, self.onStart)
  99. pub.subscribe(events.WINDOW_RESTART, self.onStart)
  100. pub.subscribe(events.WINDOW_STOP, self.onStopExecution)
  101. pub.subscribe(events.WINDOW_CLOSE, self.onClose)
  102. pub.subscribe(events.WINDOW_CANCEL, self.onCancel)
  103. pub.subscribe(events.WINDOW_EDIT, self.onEdit)
  104. pub.subscribe(events.CONSOLE_UPDATE, self.console.logOutput)
  105. pub.subscribe(events.EXECUTION_COMPLETE, self.onComplete)
  106. pub.subscribe(events.PROGRESS_UPDATE, self.footer.updateProgressBar)
  107. pub.subscribe(events.TIME_UPDATE, self.footer.updateTimeRemaining)
  108. # Top level wx close event
  109. # self.Bind(wx.EVT_CLOSE, self.onClose)
  110. # TODO: handle child focus for per-field level validation.
  111. # self.Bind(wx.EVT_CHILD_FOCUS, self.handleFocus)
  112. if self.buildSpec.get('auto_start', False):
  113. self.onStart()
  114. def applyConfiguration(self):
  115. self.SetTitle(self.buildSpec['program_name'])
  116. self.SetBackgroundColour(self.buildSpec.get('body_bg_color'))
  117. def onStart(self, *args, **kwarg):
  118. """
  119. Verify user input and kick off the client's program if valid
  120. """
  121. # navigates away from the button because a
  122. # disabled focused button still looks enabled.
  123. self.footer.cancel_button.Disable()
  124. self.footer.start_button.Disable()
  125. self.footer.start_button.Navigate()
  126. if Events.VALIDATE_FORM in self.buildSpec.get('use_events', []):
  127. # TODO: make this wx thread safe so that it can
  128. # actually run asynchronously
  129. Thread(target=self.onStartAsync).run()
  130. else:
  131. Thread(target=self.onStartAsync).run()
  132. def onStartAsync(self, *args, **kwargs):
  133. with transactUI(self):
  134. try:
  135. errors = self.validateForm().getOrThrow()
  136. if errors: # TODO
  137. config = self.navbar.getActiveConfig()
  138. config.setErrors(errors)
  139. self.Layout()
  140. # TODO: account for tabbed layouts
  141. # TODO: scroll the first error into view
  142. # TODO: rather than just snapping to the top
  143. self.configs[0].Scroll(0, 0)
  144. else:
  145. if self.buildSpec['clear_before_run']:
  146. self.console.clear()
  147. self.clientRunner.run(self.buildCliString())
  148. self.showConsole()
  149. except CalledProcessError as e:
  150. self.showError()
  151. self.console.appendText(str(e))
  152. self.console.appendText(
  153. '\n\nThis failure happens when Gooey tries to invoke your '
  154. 'code for the VALIDATE_FORM event and receives an expected '
  155. 'error code in response.'
  156. )
  157. wx.CallAfter(modals.showFailure)
  158. except JSONDecodeError as e:
  159. self.showError()
  160. self.console.appendText(str(e))
  161. self.console.appendText(
  162. '\n\nGooey was unable to parse the response to the VALIDATE_FORM event. '
  163. 'This can happen if you have additional logs to stdout beyond what Gooey '
  164. 'expects.'
  165. )
  166. wx.CallAfter(modals.showFailure)
  167. # for some reason, we have to delay the re-enabling of
  168. # the buttons by a few ms otherwise they pickup pending
  169. # events created while they were disabled. Trial and error
  170. # let to this solution.
  171. wx.CallLater(20, self.footer.start_button.Enable)
  172. wx.CallLater(20, self.footer.cancel_button.Enable)
  173. def onEdit(self):
  174. """Return the user to the settings screen for further editing"""
  175. with transactUI(self):
  176. for config in self.configs:
  177. config.resetErrors()
  178. self.showSettings()
  179. def onComplete(self, *args, **kwargs):
  180. """
  181. Display the appropriate screen based on the success/fail of the
  182. host program
  183. """
  184. with transactUI(self):
  185. if self.clientRunner.was_success():
  186. if self.buildSpec.get('return_to_config', False):
  187. self.showSettings()
  188. else:
  189. self.showSuccess()
  190. if self.buildSpec.get('show_success_modal', True):
  191. wx.CallAfter(modals.showSuccess)
  192. else:
  193. if self.clientRunner.wasForcefullyStopped:
  194. self.showForceStopped()
  195. else:
  196. self.showError()
  197. if self.buildSpec.get('show_failure_modal'):
  198. wx.CallAfter(modals.showFailure)
  199. def onCancel(self):
  200. """Close the program after confirming
  201. We treat the behavior of the "cancel" button slightly
  202. differently than the general window close X button only
  203. because this is 'part of' the form.
  204. """
  205. if modals.confirmExit():
  206. self.onClose()
  207. def onStopExecution(self):
  208. """Displays a scary message and then force-quits the executing
  209. client code if the user accepts"""
  210. if self.shouldStopExecution():
  211. self.clientRunner.stop()
  212. def onClose(self, *args, **kwargs):
  213. """Stop any actively running client program, cleanup the top
  214. level WxFrame and shutdown the current process"""
  215. # issue #592 - we need to run the same onStopExecution machinery
  216. # when the exit button is clicked to ensure everything is cleaned
  217. # up correctly.
  218. if self.clientRunner.running():
  219. if self.shouldStopExecution():
  220. self.clientRunner.stop()
  221. self.destroyGooey()
  222. else:
  223. self.destroyGooey()
  224. def buildCliString(self) -> str:
  225. """
  226. Collect all of the required information from the config screen and
  227. build a CLI string which can be used to invoke the client program
  228. """
  229. cmd = self.getCommandDetails()
  230. return cli.cliCmd(
  231. cmd.target,
  232. cmd.subcommand,
  233. cmd.positionals,
  234. cmd.optionals,
  235. suppress_gooey_flag=self.buildSpec['suppress_gooey_flag']
  236. )
  237. def validateForm(self) -> Try[Mapping[str, str]]:
  238. config = self.navbar.getActiveConfig()
  239. localErrors: Mapping[str, str] = config.getErrors()
  240. dynamicResult: Try[Mapping[str, str]] = self.fetchDynamicValidations()
  241. combineErrors = lambda m: merge(localErrors, m)
  242. return dynamicResult.map(combineErrors)
  243. def fetchDynamicValidations(self) -> Try[Mapping[str, str]]:
  244. # only run the dynamic validation if the user has
  245. # specifically subscribed to that event
  246. if Events.VALIDATE_FORM in self.buildSpec.get('use_events', []):
  247. cmd = self.getCommandDetails()
  248. return seeder.communicate(cli.formValidationCmd(
  249. cmd.target,
  250. cmd.subcommand,
  251. cmd.positionals,
  252. cmd.optionals
  253. ), self.buildSpec['encoding'])
  254. else:
  255. # shim response if nothing to do.
  256. return Success({})
  257. def getCommandDetails(self) -> CommandDetails:
  258. """
  259. Temporary helper for getting the state of the current Config.
  260. To be deprecated upon (the desperately needed) refactor.
  261. """
  262. config = self.navbar.getActiveConfig()
  263. group = self.buildSpec['widgets'][self.navbar.getSelectedGroup()]
  264. return CommandDetails(
  265. self.buildSpec['target'],
  266. group['command'],
  267. config.getPositionalValues(),
  268. config.getOptionalValues(),
  269. )
  270. def shouldStopExecution(self):
  271. return not self.buildSpec['show_stop_warning'] or modals.confirmForceStop()
  272. def destroyGooey(self):
  273. self.Destroy()
  274. sys.exit()
  275. def block(self, **kwargs):
  276. pass
  277. def layoutComponent(self):
  278. sizer = wx.BoxSizer(wx.VERTICAL)
  279. # sizer.Add(self.hhh, 0, wx.EXPAND)
  280. sizer.Add(self.header, 0, wx.EXPAND)
  281. sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
  282. sizer.Add(self.navbar, 1, wx.EXPAND)
  283. sizer.Add(self.console, 1, wx.EXPAND)
  284. sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
  285. # sizer.Add(self.fff, 0, wx.EXPAND)
  286. sizer.Add(self.footer, 0, wx.EXPAND)
  287. self.SetMinSize((400, 300))
  288. self.SetSize(self.buildSpec['default_size'])
  289. self.SetSizer(sizer)
  290. self.console.Hide()
  291. self.Layout()
  292. if self.buildSpec.get('fullscreen', True):
  293. self.ShowFullScreen(True)
  294. # Program Icon (Windows)
  295. icon = wx.Icon(self.buildSpec['images']['programIcon'], wx.BITMAP_TYPE_PNG)
  296. self.SetIcon(icon)
  297. if sys.platform != 'win32':
  298. # OSX needs to have its taskbar icon explicitly set
  299. # bizarrely, wx requires the TaskBarIcon to be attached to the Frame
  300. # as instance data (self.). Otherwise, it will not render correctly.
  301. self.taskbarIcon = TaskBarIcon(iconType=wx.adv.TBI_DOCK)
  302. self.taskbarIcon.SetIcon(icon)
  303. def buildNavigation(self):
  304. """
  305. Chooses the appropriate layout navigation component based on user prefs
  306. """
  307. if self.buildSpec['navigation'] == constants.TABBED:
  308. navigation = Tabbar(self, self.buildSpec, self.configs)
  309. else:
  310. navigation = Sidebar(self, self.buildSpec, self.configs)
  311. if self.buildSpec['navigation'] == constants.HIDDEN:
  312. navigation.Hide()
  313. return navigation
  314. def buildConfigPanels(self, parent):
  315. page_class = TabbedConfigPage if self.buildSpec['tabbed_groups'] else ConfigPage
  316. return [page_class(parent, widgets, self.buildSpec)
  317. for widgets in self.buildSpec['widgets'].values()]
  318. def showSettings(self):
  319. self.navbar.Show(True)
  320. self.console.Show(False)
  321. self.header.setImage('settings_img')
  322. self.header.setTitle(_("settings_title"))
  323. self.header.setSubtitle(self.buildSpec['program_description'])
  324. self.footer.showButtons('cancel_button', 'start_button')
  325. self.footer.progress_bar.Show(False)
  326. self.footer.time_remaining_text.Show(False)
  327. def showConsole(self):
  328. self.navbar.Show(False)
  329. self.console.Show(True)
  330. self.header.setImage('running_img')
  331. self.header.setTitle(_("running_title"))
  332. self.header.setSubtitle(_('running_msg'))
  333. self.footer.showButtons('stop_button')
  334. if not self.buildSpec.get('disable_progress_bar_animation', False):
  335. self.footer.progress_bar.Show(True)
  336. self.footer.time_remaining_text.Show(False)
  337. if self.buildSpec.get('timing_options')['show_time_remaining']:
  338. self.timer.start()
  339. self.footer.time_remaining_text.Show(True)
  340. if not self.buildSpec['progress_regex']:
  341. self.footer.progress_bar.Pulse()
  342. def showComplete(self):
  343. self.navbar.Show(False)
  344. self.console.Show(True)
  345. buttons = (['edit_button', 'restart_button', 'close_button']
  346. if self.buildSpec.get('show_restart_button', True)
  347. else ['edit_button', 'close_button'])
  348. self.footer.showButtons(*buttons)
  349. self.footer.progress_bar.Show(False)
  350. if self.buildSpec.get('timing_options')['show_time_remaining']:
  351. self.timer.stop()
  352. self.footer.time_remaining_text.Show(True)
  353. if self.buildSpec.get('timing_options')['hide_time_remaining_on_complete']:
  354. self.footer.time_remaining_text.Show(False)
  355. def showSuccess(self):
  356. self.showComplete()
  357. self.header.setImage('check_mark')
  358. self.header.setTitle(_('finished_title'))
  359. self.header.setSubtitle(_('finished_msg'))
  360. self.Layout()
  361. def showError(self):
  362. self.showComplete()
  363. self.header.setImage('error_symbol')
  364. self.header.setTitle(_('finished_title'))
  365. self.header.setSubtitle(_('finished_error'))
  366. def showForceStopped(self):
  367. self.showComplete()
  368. if self.buildSpec.get('force_stop_is_error', True):
  369. self.showError()
  370. else:
  371. self.showSuccess()
  372. self.header.setSubtitle(_('finished_forced_quit'))