Skip to content

Commit

Permalink
get_info ignore if tt=False
Browse files Browse the repository at this point in the history
  • Loading branch information
divi255 committed Aug 29, 2019
1 parent 674297c commit babc537
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion atasker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2018-2019 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "0.3.24"
__version__ = "0.3.25"

from atasker.supervisor import TaskSupervisor
from atasker.supervisor import TASK_LOW
Expand Down
2 changes: 1 addition & 1 deletion atasker/co.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2018-2019 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "0.3.24"
__version__ = "0.3.25"

from atasker import task_supervisor

Expand Down
2 changes: 1 addition & 1 deletion atasker/f.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2018-2019 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "0.3.24"
__version__ = "0.3.25"

import traceback
import threading
Expand Down
23 changes: 13 additions & 10 deletions atasker/supervisor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2018-2019 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "0.3.24"
__version__ = "0.3.25"

import threading
import multiprocessing
Expand Down Expand Up @@ -414,21 +414,24 @@ class SupervisorInfo:
setattr(result, 'thread_' + p, getattr(self, 'thread_' + p))
if self.mp_pool and (tt == TT_MP or tt is None):
setattr(result, 'mp_' + p, getattr(self, 'mp_' + p))
if tt == TT_THREAD or tt is None:
result.thread_tasks = list(self._active_threads)
result.threads_active = list(self._active_threads_by_t)
if tt == TT_THREAD or tt is None or tt is False:
if not tt is False:
result.thread_tasks = list(self._active_threads)
result.threads_active = list(self._active_threads_by_t)
result.thread_tasks_count = len(result.thread_tasks)
if tt == TT_MP or tt is None:
result.mp_tasks = list(self._active_mps)
if tt == TT_MP or tt is None or tt is False:
if not tt is False:
result.mp_tasks = list(self._active_mps)
result.mp_tasks_count = len(result.mp_tasks)
if aloops:
result.aloops = self.aloops.copy()
if schedulers:
result.schedulers = self._schedulers.copy()
result.tasks = {}
for n, v in self._tasks.items():
if tt is None or v.tt == tt:
result.tasks[n] = v
if tt != False:
result.tasks = {}
for n, v in self._tasks.items():
if tt is None or v.tt == tt:
result.tasks[n] = v
return result

def get_aloops(self):
Expand Down
2 changes: 1 addition & 1 deletion atasker/threads.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2018-2019 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "0.3.24"
__version__ = "0.3.25"

import threading
import time
Expand Down
2 changes: 1 addition & 1 deletion atasker/workers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2018-2019 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "0.3.24"
__version__ = "0.3.25"

import threading
import logging
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.3.24"
__version__ = "0.3.25"

import setuptools

Expand Down
2 changes: 1 addition & 1 deletion tests/mp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2018-2019 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "0.3.24"
__version__ = "0.3.25"

def test(*args, **kwargs):
print('test mp method {} {}'.format(args, kwargs))
Expand Down
2 changes: 1 addition & 1 deletion tests/mpworker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2018-2019 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "0.3.24"
__version__ = "0.3.25"

from atasker import BackgroundIntervalWorker

Expand Down
2 changes: 1 addition & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__author__ = "Altertech Group, https://www.altertech.com/"
__copyright__ = "Copyright (C) 2018-2019 Altertech Group"
__license__ = "Apache License 2.0"
__version__ = "0.3.24"
__version__ = "0.3.25"

from pathlib import Path

Expand Down

0 comments on commit babc537

Please sign in to comment.