Commit d6db7c8a authored by Jibril Mammeri's avatar Jibril Mammeri
Browse files

Protect positioner property

parent ca895bf4
Pipeline #39085 passed with stages
in 99 minutes and 4 seconds
...@@ -354,7 +354,7 @@ class MapWithAliases(Map): ...@@ -354,7 +354,7 @@ class MapWithAliases(Map):
def get_axes_names_iter(self): def get_axes_names_iter(self):
for axis in self.get_axes_iter(): for axis in self.get_axes_iter():
if axis.positioner: if axis._positioner:
yield axis.name yield axis.name
def get_axes_positions_iter(self, on_error=None): def get_axes_positions_iter(self, on_error=None):
...@@ -373,7 +373,7 @@ class MapWithAliases(Map): ...@@ -373,7 +373,7 @@ class MapWithAliases(Map):
tasks = list() tasks = list()
for axis in self.get_axes_iter(): for axis in self.get_axes_iter():
if axis.positioner: if axis._positioner:
tasks.append(gevent.spawn(request, axis)) tasks.append(gevent.spawn(request, axis))
gevent.joinall(tasks) gevent.joinall(tasks)
......
...@@ -741,12 +741,12 @@ class Axis: ...@@ -741,12 +741,12 @@ class Axis:
return self.__name return self.__name
@property @property
def positioner(self): def _positioner(self):
"""Axis positioner""" """Axis positioner"""
return self.__positioner return self.__positioner
@positioner.setter @_positioner.setter
def positioner(self, new_p): def _positioner(self, new_p):
self.__positioner = new_p self.__positioner = new_p
@autocomplete_property @autocomplete_property
......
...@@ -21,7 +21,6 @@ def SoftAxis( ...@@ -21,7 +21,6 @@ def SoftAxis(
tolerance=None, tolerance=None,
export_to_session=True, export_to_session=True,
unit=None, unit=None,
positioner=False,
): ):
# if callable(position): # if callable(position):
...@@ -48,7 +47,7 @@ def SoftAxis( ...@@ -48,7 +47,7 @@ def SoftAxis(
controller._init() controller._init()
axis = controller.get_axis(name) axis = controller.get_axis(name)
axis.positioner = positioner axis._positioner = False
if export_to_session: if export_to_session:
current_session = get_current_session() current_session = get_current_session()
......
...@@ -100,5 +100,5 @@ def test_soft_axis_iter_position_all(session): ...@@ -100,5 +100,5 @@ def test_soft_axis_iter_position_all(session):
o = Object() o = Object()
m0 = SoftAxis("bla", o) m0 = SoftAxis("bla", o)
assert not any(whereall.axis_name == "bla" for whereall in iter_axes_position_all()) assert not any(whereall.axis_name == "bla" for whereall in iter_axes_position_all())
m0.positioner = True m0._positioner = True
assert any(whereall.axis_name == "bla" for whereall in iter_axes_position_all()) assert any(whereall.axis_name == "bla" for whereall in iter_axes_position_all())
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