Skip to content

Commit 70b35ea

Browse files
committed
Remove @Pyro4.behavior(instance_mode='single') (issue #49)
Setting Pyro's instance mode behaviour to 'single' means that a single instance of the decorated class is created and used for all methods calls. This is the same as creating and registering an instance with the Pyro daemon which is what deviceserver already does. This commit removes those decorators which are doing nothing. This makes the concrete classes independent of Pyro.
1 parent ccacb44 commit 70b35ea

File tree

4 files changed

+1
-10
lines changed

4 files changed

+1
-10
lines changed

microscope/cameras/andorsdk3.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import queue
2626
import time
2727

28-
import Pyro4
2928
import numpy as np
3029

3130
from microscope import devices
@@ -176,7 +175,7 @@ def wrapper(self, *args, **kwargs):
176175
'_aoi_binning', '_aoi_left', '_aoi_top',
177176
'_aoi_width', '_aoi_height', ]
178177

179-
@Pyro4.behavior('single')
178+
180179
class AndorSDK3(devices.FloatingDeviceMixin,
181180
devices.CameraDevice):
182181
SDK_INITIALIZED = False

microscope/cameras/pvcam.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,6 @@ def values(self):
11781178
return values
11791179

11801180

1181-
@Pyro4.behavior('single')
11821181
class PVCamera(devices.FloatingDeviceMixin, devices.CameraDevice):
11831182
"""Implements the CameraDevice interface for the pvcam library."""
11841183
# Keep track of open cameras.

microscope/cameras/ximea.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
## You should have received a copy of the GNU General Public License
2020
## along with Microscope. If not, see <http://www.gnu.org/licenses/>.
2121

22-
import Pyro4
2322
import numpy as np
2423

2524
from microscope import devices
@@ -49,8 +48,6 @@
4948
# }
5049

5150

52-
53-
@Pyro4.behavior('single')
5451
class XimeaCamera(devices.CameraDevice):
5552
def __init__(self, **kwargs):
5653
super().__init__(**kwargs)

microscope/testsuite/devices.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import random
2323
import time
2424

25-
import Pyro4
2625
import numpy as np
2726
from PIL import Image, ImageFont, ImageDraw
2827

@@ -137,7 +136,6 @@ def sawtooth(self, w, h, dark, light):
137136
return dark + light * ((np.sin(th)*xx + np.cos(th)*yy) % wrap) / (wrap)
138137

139138

140-
@Pyro4.behavior('single')
141139
class TestCamera(devices.CameraDevice):
142140
def __init__(self, **kwargs):
143141
super().__init__(**kwargs)
@@ -381,7 +379,6 @@ def get_current_pattern(self):
381379
return self._current_pattern
382380

383381

384-
@Pyro4.behavior('single')
385382
class DummySLM(devices.Device):
386383
def __init__(self, **kwargs):
387384
super().__init__(**kwargs)
@@ -424,7 +421,6 @@ def get_sequence_index(self):
424421
return self.sequence_index
425422

426423

427-
@Pyro4.behavior('single')
428424
class DummyDSP(devices.Device):
429425
def __init__(self, **kwargs):
430426
super().__init__(**kwargs)

0 commit comments

Comments
 (0)