Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

mulled: use threading.Event in PrintProgress to avoid unnecessary waiting #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ language: python
python: 2.7
env:
- TOX_ENV=py27-lint
- TOX_ENV=py34-lint
- TOX_ENV=py35-lint
- TOX_ENV=py27-lint-readme
- TOX_ENV=py27
- TOX_ENV=py34
- TOX_ENV=py35
- TOX_ENV=py27-lint-docstring-include-list

install:
Expand Down
8 changes: 4 additions & 4 deletions galaxy/tools/deps/mulled/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,21 @@ def v2_image_name(targets, image_build=None, name_override=None):
class PrintProgress(object):
def __init__(self):
self.thread = threading.Thread(target=self.progress)
self.stop = False
self.stop = threading.Event()

def progress(self):
while not self.stop:
while not self.stop.is_set():
print(".", end="")
sys.stdout.flush()
time.sleep(60)
self.stop.wait(60)
print("")

def __enter__(self):
self.thread.start()
return self

def __exit__(self, exc_type, exc_val, exc_tb):
self.stop = True
self.stop.set()
self.thread.join()


Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO: implement doc linting
[tox]
envlist = py34-lint, py27-lint, py27-lint-readme, py27, py34, py27-lint-docstring, py27-lint-docstring-include-list
envlist = py35-lint, py27-lint, py27-lint-readme, py27, py35, py27-lint-docstring, py27-lint-docstring-include-list
source_dir = galaxy
test_dir = tests

Expand All @@ -19,7 +19,7 @@ deps =
flake8
flake8-import-order

[testenv:py34-lint]
[testenv:py35-lint]
commands = flake8 {[tox]source_dir} {[tox]test_dir}
skip_install = True
deps = flake8
Expand Down