projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '17983-fuse-unlock-relock' into main refs #17983
[arvados.git]
/
tools
/
crunchstat-summary
/
crunchstat_summary
/
reader.py
diff --git
a/tools/crunchstat-summary/crunchstat_summary/reader.py
b/tools/crunchstat-summary/crunchstat_summary/reader.py
index 311c006c07d882a40ee5af8eaae651ba1e3c7145..8ccdbc2fcf04e45ca3ab3ec6e2270933d050ea1c 100644
(file)
--- a/
tools/crunchstat-summary/crunchstat_summary/reader.py
+++ b/
tools/crunchstat-summary/crunchstat_summary/reader.py
@@
-2,11
+2,9
@@
#
# SPDX-License-Identifier: AGPL-3.0
#
# SPDX-License-Identifier: AGPL-3.0
-from __future__ import print_function
-
import arvados
import itertools
import arvados
import itertools
-import
Q
ueue
+import
q
ueue
import threading
from crunchstat_summary import logger
import threading
from crunchstat_summary import logger
@@
-87,19
+85,21
@@
class LiveLogReader(object):
self._queue.put(self.EOF)
def __iter__(self):
self._queue.put(self.EOF)
def __iter__(self):
- self._queue =
Q
ueue.Queue()
+ self._queue =
q
ueue.Queue()
self._thread = threading.Thread(target=self._get_all_pages)
self._thread.daemon = True
self._thread.start()
return self
self._thread = threading.Thread(target=self._get_all_pages)
self._thread.daemon = True
self._thread.start()
return self
- def
next
(self):
+ def
__next__
(self):
line = self._queue.get()
if line is self.EOF:
self._thread.join()
raise StopIteration
return line
line = self._queue.get()
if line is self.EOF:
self._thread.join()
raise StopIteration
return line
+ next = __next__ # for Python 2
+
def __enter__(self):
return self
def __enter__(self):
return self