Skip to content

Commit

Permalink
Make it possible to disable command pool spinners
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed May 27, 2016
1 parent a6ef02e commit 6a901d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion executor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
unicode = str

# Semi-standard module versioning.
__version__ = '9.10'
__version__ = '9.11'

# Initialize a logger.
logger = logging.getLogger(__name__)
Expand Down
15 changes: 13 additions & 2 deletions executor/concurrent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Programmer friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: November 8, 2015
# Last Change: May 27, 2016
# URL: https://executor.readthedocs.org

"""
Expand Down Expand Up @@ -145,6 +145,17 @@ def results(self):
"""
return dict(self.commands)

@mutable_property
def spinner(self):
"""
Whether to show an animated spinner or not (a boolean or :data:`None`).
The value of :attr:`spinner` defaults to :data:`None` which means a
spinner is shown when we're connected to a terminal but hidden when
we're not connected to a terminal.
"""
return None

@property
def unexpected_failures(self):
"""
Expand Down Expand Up @@ -214,7 +225,7 @@ def run(self):
pluralize(self.num_commands, "command"),
self.concurrency)
try:
with Spinner(timer=timer) as spinner:
with Spinner(interactive=self.spinner, timer=timer) as spinner:
while not self.is_finished:
self.spawn()
self.collect()
Expand Down

0 comments on commit 6a901d7

Please sign in to comment.