Commit 442f61cf authored by Vincent Michel's avatar Vincent Michel
Browse files

Remove some trailing whitespaces

parent 7e92ac56
......@@ -116,7 +116,13 @@ def _watch_data(scan_node, scan_info, scan_new_child_callback,
scan_data_callback):
scan_data = dict()
data_indexes = dict()
scan_info = scan_node.info.get_all()
if scan_info.get('type') == 'ct':
return
scan_new_callback(scan_info)
scan_data_iterator = DataNodeIterator(scan_node)
for event_type, data_channel in scan_data_iterator.walk_events():
if event_type == scan_data_iterator.NEW_CHILD_EVENT:
......
......@@ -78,7 +78,7 @@ class SamplingCounterAcquisitionDevice(BaseCounterAcquisitionDevice):
"""
Helper to manage acquisition of a sampling counter.
counters_or_groupreadhandler -- can be a list,tuple of SamplingCounter or
counters_or_groupreadhandler -- can be a list,tuple of SamplingCounter or
a group_read_handler
count_time -- the master integration time.
mode -- three mode are available *SIMPLE_AVERAGE* (the default)
......
......@@ -59,7 +59,7 @@ class LimaAcquisitionMaster(AcquisitionMaster):
self._reading_task = None
self._latency = latency_time
self._last_image_ready = -1
def prepare_saving(self, scan_name, scan_file_dir):
camera_name = self.device.camera_type
full_path = os.path.join(scan_file_dir, self.device.user_detector_name)
......@@ -76,7 +76,7 @@ class LimaAcquisitionMaster(AcquisitionMaster):
self.parameters.setdefault('saving_mode', 'MANUAL')
def prepare(self):
self._image_channel.description.update(self.parameters)
self._image_channel.description.update(self.parameters)
for param_name, param_value in self.parameters.iteritems():
setattr(self.device, param_name, param_value)
......@@ -109,7 +109,7 @@ class LimaAcquisitionMaster(AcquisitionMaster):
def wait_ready(self):
acq_trigger_mode = self.parameters.get('acq_trigger_mode','INTERNAL_TRIGGER')
if acq_trigger_mode == 'INTERNAL_TRIGGER_MULTI':
while(self.device.acq_status.lower() == 'running' and
not self.device.ready_for_next_image):
......@@ -119,7 +119,7 @@ class LimaAcquisitionMaster(AcquisitionMaster):
def trigger(self):
self.trigger_slaves()
self.device.startAcq()
if self._reading_task is None:
......@@ -152,7 +152,7 @@ class LimaAcquisitionMaster(AcquisitionMaster):
except:
self._image_channel.emit({"acq_state": "fault"})
raise
def wait_reading(self, block=True):
try:
return self._reading_task.get(block=block) if self._reading_task is not None else True
......
......@@ -46,7 +46,7 @@ class MusstAcquisitionDevice(AcquisitionDevice):
self._iter_index = 0
self._ready_flag = True
self._ready_event = event.Event()
def __iter__(self):
if isinstance(self.vars, (list, tuple)):
vars_iter = iter(self.vars)
......
......@@ -54,10 +54,10 @@ def test_scan_node(beacon, redis_data_conn, scan_tmpdir):
s = Scan(chain, "test_scan", parent, { "metadata": 42 })
assert s.name == "test_scan_1"
assert s.root_node == parent
assert isinstance(s.node, ScanNode)
assert isinstance(s.node, ScanNode)
assert s.node.type == "scan"
assert s.node.db_name == s.root_node.db_name+":"+s.name
scan_node_dict = redis_data_conn.hgetall(s.node.db_name)
assert scan_node_dict.get('name') == "test_scan_1"
assert scan_node_dict.get('db_name') == s.node.db_name
......@@ -66,8 +66,8 @@ def test_scan_node(beacon, redis_data_conn, scan_tmpdir):
scan_info_dict = redis_data_conn.hgetall(s.node.db_name+"_info")
assert pickle.loads(scan_info_dict['metadata']) == 42
with gevent.Timeout(5):
with gevent.Timeout(5):
s.run()
m0_node_db_name = s.node.db_name+":roby"
......@@ -98,7 +98,7 @@ def test_data_iterator_event(beacon, redis_data_conn, scan_tmpdir):
for e, n in DataNodeIterator(get_node(scan_db_name)).walk_events():
if n.type == 'channel':
channels[n.name] = n.get(0, -1)
scan_saving = getattr(setup_globals, "SCAN_SAVING")
scan_saving.base_path=str(scan_tmpdir)
parent = scan_saving.get_parent_node()
......@@ -115,7 +115,7 @@ def test_data_iterator_event(beacon, redis_data_conn, scan_tmpdir):
iteration_greenlet = gevent.spawn(iterate_channel_events, s.node.db_name, channels_data)
s.run()
time.sleep(0.1)
iteration_greenlet.kill()
......@@ -140,7 +140,7 @@ def test_reference_with_lima(beacon, redis_data_conn, scan_tmpdir, lima_simulato
image_node_db_name = '%s:timer:lima_simulator:image' % timescan.node.db_name
assert image_node_db_name in db_names
live_ref_status = QueueObjSetting("%s_data" % image_node_db_name, connection=redis_data_conn)[0]
assert live_ref_status['last_image_saved'] == 2 #npoints-1
......@@ -154,7 +154,7 @@ def test_iterator_over_reference_with_lima(beacon, redis_data_conn, scan_tmpdir,
lima_sim = getattr(setup_globals, "lima_simulator")
scan_greenlet = gevent.spawn(scans.timescan, exp_time, lima_sim, npoints=npoints)
gevent.sleep(exp_time) #sleep time to let time for session creation
session_node = get_node(session.name)
......@@ -173,7 +173,7 @@ def test_iterator_over_reference_with_lima(beacon, redis_data_conn, scan_tmpdir,
# make another scan -> this should make a new buffer on Lima server,
# so images from previous view cannot be retrieved from server anymore
scans.timescan(exp_time, lima_sim, npoints=1)
view_iterator2 = iter(view)
# retrieve from file
......@@ -183,9 +183,3 @@ def test_iterator_over_reference_with_lima(beacon, redis_data_conn, scan_tmpdir,
assert pytest.raises(RuntimeError, view_iterator2.next)
else:
assert view_iterator2.next() == img0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment