Skip to content

Commit

Permalink
Merge branch 'pb-fixes' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
alan committed Sep 30, 2020
2 parents ec7752c + c4620c9 commit d8d6746
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eta/core/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class AnnotationConfig(Config):
available. If set to ``True``, this overrides all other confidence
flags
hide_attr_values: (None) an optional list of attribute values (of any
kind) to _not render_
kind) to *not render*
hide_false_boolean_attrs: (False) whether to hide attributes (of any
kind) when they are ``False``
confidence_scaled_alpha: (False) whether to scale alpha values of
Expand Down
13 changes: 10 additions & 3 deletions eta/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ def __init__(
self._start_msg = start_msg
self._complete_msg = complete_msg
self._max_width = max_width
self._has_dynamic_width = max_width is None
self._has_dynamic_width = max_width is None and not quiet
self._max_fps = max_fps
self._timer = Timer(quiet=True)
self._is_running = False
Expand Down Expand Up @@ -1088,7 +1088,11 @@ def __init__(
if self._has_dynamic_width:
self._update_max_width()
if hasattr(signal, "SIGWINCH"):
signal.signal(signal.SIGWINCH, self._update_max_width)
try:
signal.signal(signal.SIGWINCH, self._update_max_width)
except ValueError:
# for example, called from a non-main thread
pass

def __enter__(self):
self.start()
Expand Down Expand Up @@ -1276,7 +1280,10 @@ def close(self, *args):
logger.info(self._complete_msg)

if self.has_dynamic_width and hasattr(signal, "SIGWINCH"):
signal.signal(signal.SIGWINCH, signal.SIG_DFL)
try:
signal.signal(signal.SIGWINCH, signal.SIG_DFL)
except ValueError:
pass

def update(self, count=1, suffix=None, draw=True):
"""Increments the current iteration count by the given value
Expand Down

0 comments on commit d8d6746

Please sign in to comment.