Skip to content

Commit

Permalink
feature: Forward compatible use of queue module
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjbillington committed Jul 28, 2017
1 parent 65c5a42 commit 40d25bc
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import six
if six.PY2:
str = unicode
import Queue as queue
else:
import queue

# stdlib imports

Expand Down Expand Up @@ -1496,7 +1499,7 @@ def __init__(self, container, exp_config, to_singleshot, from_singleshot, to_mul
# A queue for storing incoming files from the ZMQ server so
# the server can keep receiving files even if analysis is slow
# or paused:
self.incoming_queue = Queue.Queue()
self.incoming_queue = queue.Queue()

# Start the thread to handle incoming files, and store them in
# a buffer if processing is paused:
Expand Down Expand Up @@ -1601,7 +1604,7 @@ def incoming_buffer_loop(self):
while True:
try:
filepath = self.incoming_queue.get(False)
except Queue.Empty:
except queue.Empty:
break
else:
filepaths.append(filepath)
Expand Down Expand Up @@ -1755,12 +1758,12 @@ def __init__(self):

# The singleshot routinebox will be connected to the filebox
# by queues:
to_singleshot = Queue.Queue()
from_singleshot = Queue.Queue()
to_singleshot = queue.Queue()
from_singleshot = queue.Queue()

# So will the multishot routinebox:
to_multishot = Queue.Queue()
from_multishot = Queue.Queue()
to_multishot = queue.Queue()
from_multishot = queue.Queue()

self.output_box = OutputBox(self.ui.verticalLayout_output_box)
self.singleshot_routinebox = RoutineBox(self.ui.verticalLayout_singleshot_routinebox, self.exp_config,
Expand Down

0 comments on commit 40d25bc

Please sign in to comment.