mxcubecore 1.339.0__py3-none-any.whl → 1.341.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,9 +87,6 @@ class DefaultSpecificState(enum.Enum):
87
87
  class ConfiguredObject:
88
88
  """Superclass for classes that take configuration from YAML files"""
89
89
 
90
- # class HOConfig(pydantic.BaseModel):
91
- # model_config = pydantic.ConfigDict(extra="allow")
92
-
93
90
  class HOConfig:
94
91
  """Temporary replacement for Pydantic class
95
92
 
@@ -18,15 +18,6 @@
18
18
  # You should have received a copy of the GNU Lesser General Public License
19
19
  # along with MXCuBE. If not, see <http://www.gnu.org/licenses/>.
20
20
 
21
- # import time
22
- # import logging
23
- # import weakref
24
-
25
- # try:
26
- # import Queue as queue
27
- # except ImportError:
28
- # import queue
29
-
30
21
 
31
22
  from mxcubecore.CommandContainer import (
32
23
  ChannelObject,
@@ -251,7 +251,6 @@ class PoolChannel(ChannelObject):
251
251
  s = self.device.State()
252
252
  except Exception:
253
253
  pass
254
- # logging.getLogger("HWR").exception("Could not read State attribute")
255
254
  else:
256
255
  if s == PyTango.DevState.OFF:
257
256
  return
@@ -278,9 +277,6 @@ class PoolChannel(ChannelObject):
278
277
  return self.value
279
278
 
280
279
  def set_value(self, new_value):
281
- # newval = PyTango.AttributeValue()
282
- # newval.value = newValue
283
- # self.device.write_attribute(self.attribute_name, newval)
284
280
  attr = PyTango.AttributeProxy(self.device_name + "/" + self.attribute_name)
285
281
  a = attr.read()
286
282
  a.value = new_value
@@ -29,8 +29,6 @@ import os
29
29
  import gevent
30
30
  from gevent.event import Event
31
31
 
32
- # import time
33
- # import types
34
32
  from mxcubecore.dispatcher import saferef
35
33
 
36
34
  try:
@@ -156,17 +154,6 @@ class SardanaMacro(CommandObject, SardanaObject, ChannelObject):
156
154
  self.door.set_timeout_millis(10000)
157
155
  self.doorstate = self.door.state.name.upper()
158
156
 
159
- #
160
- # DIRTY FIX to make compatible taurus listeners and existence of Tango channels/commands
161
- # as defined in Command/Tango.py
162
- #
163
- # if self.door.__class__ == taurus.core.tango.tangodevice.TangoDevice:
164
- # dp = self.door.getHWObj()
165
- # try:
166
- # dp.subscribe_event = dp._subscribe_event
167
- # except AttributeError:
168
- # pass
169
-
170
157
  if self.macroStatusAttr is None:
171
158
  self.macroStatusAttr = self.door.getAttribute("State")
172
159
  self.macroStatusAttr.addListener(self.object_listener)
@@ -261,9 +248,8 @@ class SardanaMacro(CommandObject, SardanaObject, ChannelObject):
261
248
 
262
249
  try:
263
250
  if not isinstance(data, PyTango.DeviceAttribute):
264
- # Events different than a value changed on attribute. Taurus sends an event with attribute info
265
- # logging.getLogger('HWR').debug("==========. Got an event, but it is not an attribute . it is %s" % type(data))
266
- # logging.getLogger('HWR').debug("doorstate event. type is %s" % str(type(data)))
251
+ # Events different than a value changed on attribute.
252
+ # Taurus sends an event with attribute info.
267
253
  return
268
254
 
269
255
  # Handling macro state changed event
@@ -275,18 +261,14 @@ class SardanaMacro(CommandObject, SardanaObject, ChannelObject):
275
261
  if doorstate != self.doorstate:
276
262
  self.doorstate = doorstate
277
263
 
278
- # logging.getLogger('HWR').debug("self.doorstate is %s" % self.canExecute())
279
264
  self.emit("commandCanExecute", (self.can_execute(),))
280
265
 
281
266
  if doorstate in ["ON", "ALARM"]:
282
- # logging.getLogger('HWR').debug("Macroserver ready for commands")
283
267
  self.emit("commandReady", ())
284
268
  else:
285
- # logging.getLogger('HWR').debug("Macroserver busy ")
286
269
  self.emit("commandNotReady", ())
287
270
 
288
271
  if self.macrostate == SardanaMacro.STARTED and doorstate == "RUNNING":
289
- # logging.getLogger('HWR').debug("Macro server is running")
290
272
  self.macrostate = SardanaMacro.RUNNING
291
273
  elif self.macrostate == SardanaMacro.RUNNING and (
292
274
  doorstate in ["ON", "ALARM"]
@@ -323,7 +305,6 @@ class SardanaMacro(CommandObject, SardanaObject, ChannelObject):
323
305
  if self.door is not None:
324
306
  logging.getLogger("HWR").debug("SardanaMacro / aborting macro")
325
307
  self.door.abortMacro()
326
- # self.emit('commandReady', ())
327
308
 
328
309
  def is_connected(self):
329
310
  return self.door is not None
@@ -417,18 +398,6 @@ class SardanaChannel(ChannelObject, SardanaObject):
417
398
  def init_device(self):
418
399
  try:
419
400
  self.attribute = Attribute(self.model)
420
- #
421
- # DIRTY FIX to make compatible taurus listeners and existence of Tango channels/commands
422
- # as defined in Command/Tango.py
423
- #
424
- # if self.attribute.__class__ == taurus.core.tango.tangoattribute.TangoAttribute:
425
- # dev = self.attribute.getParentObj()
426
- # dp = dev.getHWObj()
427
- # try:
428
- # dp.subscribe_event = dp._subscribe_event
429
- # except AttributeError:
430
- # pass
431
- # logging.getLogger("HWR").debug("initialized")
432
401
  except DevFailed as traceback:
433
402
  self.imported = False
434
403
  return
@@ -62,11 +62,9 @@ class TineCommand(CommandObject):
62
62
  else:
63
63
  commandArgument = args[0]
64
64
  try:
65
- # logging.getLogger("HWR").info("Tine command %s sent" % self.commandName)
66
65
  ret = tine.set(
67
66
  self.tineName, self.commandName, commandArgument, self.timeout
68
67
  )
69
- # logging.getLogger("HWR").info("Tine command %s reply arrived" % self.commandName)
70
68
  self.emit("commandReplyArrived", (ret, str(self.name())))
71
69
  except IOError as strerror:
72
70
  logging.getLogger("user_level_log").exception("TINE: %s" % strerror)
@@ -122,9 +120,6 @@ class TineChannel(ChannelObject):
122
120
  attach = {"timer": tine.attach, "event": tine.notify, "datachange": tine.update}
123
121
 
124
122
  updates = queue.Queue()
125
- # updates_emitter = QtCore.QTimer()
126
- # QtCore.QObject.connect(updates_emitter, QtCore.SIGNAL('timeout()'), emitTineChannelUpdates)
127
- # updates_emitter.start(20)
128
123
  updates_emitter = gevent.spawn(do_tine_channel_update, 0.1)
129
124
 
130
125
  def __init__(
@@ -167,10 +162,6 @@ class TineChannel(ChannelObject):
167
162
  self.linkid = TineChannel.attach[kwargs.get("attach", "timer")](
168
163
  self.tineName, self.attributeName, self.tineEventCallback, self.timeout
169
164
  )
170
- # except IOError as strerror:
171
- # logging.getLogger("HWR").error("%s" %strerror)
172
- # except ValueError:
173
- # logging.getLogger("HWR").error("TINE attach object is not callable")
174
165
 
175
166
  if self.linkid > 0 and kwargs.get("attach", "timer") == "datachange":
176
167
  tolerance = kwargs.get("tolerance", 0.0)
@@ -180,9 +171,6 @@ class TineChannel(ChannelObject):
180
171
  if tolerance != 0.0:
181
172
  tine.tolerance(self.linkid, float(tolerance), 0.0)
182
173
 
183
- # TODO Remove this sleep. Tine lib bug when after attach directly get is called
184
- # time.sleep(0.025)
185
-
186
174
  atexit.register(self.__del__)
187
175
 
188
176
  def __del__(self):
@@ -232,9 +220,6 @@ class TineChannel(ChannelObject):
232
220
  """
233
221
 
234
222
  def update(self, value=None):
235
- # if self.tineName.split("/")[2] == 'ics':
236
- # print '>>>>>>>>>>>>>>>>>>', self.attributeName, value, self.value, self.oldvalue
237
-
238
223
  if value is None:
239
224
  logging.getLogger("HWR").warning(
240
225
  "Update with value None on: %s %s" % (self.tineName, self.attributeName)
@@ -245,14 +230,8 @@ class TineChannel(ChannelObject):
245
230
  if value != self.oldvalue:
246
231
  TineChannel.updates.put((weakref.ref(self), value))
247
232
  self.oldvalue = value
248
- # if self.tineName == "/P14/BCUIntensity/Device0":
249
- # logging.getLogger("HWR").debug('----------------- %s %s' %(self.attributeName,self.value))
250
233
 
251
234
  def get_value(self, force=False):
252
- # logging.getLogger("HWR").debug('TINE channel %s, %s get at val=%s'%(self.tineName,self.attributeName,self.value))
253
- # if self.tineName == "/P14/BCUIntensity/Device0":
254
- # print self.attributeName, self.value
255
-
256
235
  # GB: if forced while having a value already, i.e. well after connecting a channel, do a real synchronous get and return
257
236
  if force:
258
237
  if self.value is not None:
@@ -279,7 +258,6 @@ class TineChannel(ChannelObject):
279
258
  # but now tine lib should be standing the get, so we try....
280
259
 
281
260
  self.value = self._synchronous_get()
282
- # time.sleep(0.02)
283
261
  _counter += 1
284
262
  if self.value is None:
285
263
  logging.getLogger("HWR").warning(
@@ -329,7 +329,6 @@ class CommandContainer:
329
329
  if channel is None and not optional:
330
330
  msg = "%s: Unable to get channel %s" % (self.id, channel_name)
331
331
  logging.getLogger("user_level_log").error(msg)
332
- # raise Exception(msg)
333
332
  return channel
334
333
 
335
334
  def get_channel_names_list(self) -> List[str]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mxcubecore
3
- Version: 1.339.0
3
+ Version: 1.341.0
4
4
  Summary: Core libraries for the MXCuBE application
5
5
  License: LGPL-3.0-or-later
6
6
  Keywords: mxcube,mxcube3,mxcubecore
@@ -1,20 +1,20 @@
1
- mxcubecore/BaseHardwareObjects.py,sha256=LpHUEo6B5SAv1AfuPg6Ej0bNppsZxng8t9LjdwjeP5g,41287
1
+ mxcubecore/BaseHardwareObjects.py,sha256=KuvnwMTXRZsozQcuMqhQVGdj-T6xSsaeoFu2NuprL18,41184
2
2
  mxcubecore/Command/Epics.py,sha256=9ftSEd4VdaFTE0qSrjL7LikLc_LJjz1-nNZF4J7hbWE,7748
3
3
  mxcubecore/Command/Exporter.py,sha256=HL6hncI_EUjjVX7frOsmxGa2Gyc-3PwUPXLUBJk4B20,8076
4
- mxcubecore/Command/Mockup.py,sha256=Q-kIR30mNnYSyy_f70PFx-ZVVTcPG1NRVqrrv3VCCcs,2075
5
- mxcubecore/Command/Pool.py,sha256=9JL_AjQ1cZ1JZihZ-IOPzdEP111kilBVom8S7OqlEqQ,9366
6
- mxcubecore/Command/Sardana.py,sha256=PV1me0s5UQIzWMU1eWULHJ28GgW6AVMHEr1iuU8u_C8,17338
4
+ mxcubecore/Command/Mockup.py,sha256=OrGAJC0JjTTjGSMZl7NiWJmVUQeEThMYdSQzuBD-bEc,1949
5
+ mxcubecore/Command/Pool.py,sha256=nzAeedrlQ0KVx8TixwSz4YRX1bp9Z-JhEebDnWCNVqM,9138
6
+ mxcubecore/Command/Sardana.py,sha256=EQx_DjlIpUjrjn4yEU2Xp4b04kKe19o_QJO_mL3-XD0,15747
7
7
  mxcubecore/Command/Spec.py,sha256=a3dqqXhwq1FNOo5zD9DSnVv5FgCU3jyW-lJ_QT8SNlo,3636
8
8
  mxcubecore/Command/Taco.py,sha256=FmHgwUG9zxw-suhFHlraqW8-008t5Xp1rTtmfREYRrk,5488
9
9
  mxcubecore/Command/Tango.py,sha256=XH9brwUqFutbWLk0EOrkjf6BW7KtfFIaRt0pqO-kAk0,10426
10
- mxcubecore/Command/Tine.py,sha256=5KBRqmKbiEIiDHdEx3UyA6ytNmqCRYk-hJDBwMp6H0c,11067
10
+ mxcubecore/Command/Tine.py,sha256=DbAxqYh1bdclsRhM2ISsMX8QPzfOba48XxYZlciGnK8,9810
11
11
  mxcubecore/Command/__init__.py,sha256=vYC-fwWaqcRnjtxdMbVklsB3ddcVm_Qk8HaHNyUFTtY,1455
12
12
  mxcubecore/Command/exporter/ExporterClient.py,sha256=ZugYet36FCdqDtqyLu07RP-YlqCxrGP8zQUOElPsiGY,7111
13
13
  mxcubecore/Command/exporter/ExporterStates.py,sha256=n4JXMnSOfQ9NytqEIgT-TKXtNNErMrItrfh5qKyczqk,1729
14
14
  mxcubecore/Command/exporter/MDEvents.py,sha256=C3bNJcOoJyKYgXlI_uC522zmpbqs-n4EslyXblwpX6M,7955
15
15
  mxcubecore/Command/exporter/StandardClient.py,sha256=41viYUCYTAOV1dPNMmOJQYU3Td9yEd1tTLYqh5sgkAk,10867
16
16
  mxcubecore/Command/exporter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- mxcubecore/CommandContainer.py,sha256=kVV81v-N59GFpyH5ZnvMPcP8ld0rwnXLgpWVzdYaOfo,35198
17
+ mxcubecore/CommandContainer.py,sha256=DXxmkyt8sW5eRugzVCXXcFw6h-d6V2BgVPzZ02Kr-rw,35163
18
18
  mxcubecore/HardwareObjectFileParser.py,sha256=zgSt2GXfz21klnnB57lQK8vJT7bDZhJN6RjsPX0yJq8,15577
19
19
  mxcubecore/HardwareObjects/ALBA/ALBAAutoProcessing.py,sha256=dI5GMm2Csl3GToA5Xe0eGsdlB_zzvy1y7zqpwSIJG0A,8298
20
20
  mxcubecore/HardwareObjects/ALBA/ALBABackLight.py,sha256=OWjmzQlFP3vF8eTqhN1MNclsoWmSgqzt42CBN4v9iZ4,5076
@@ -465,8 +465,8 @@ mxcubecore/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
465
465
  mxcubecore/utils/conversion.py,sha256=G1bk2Mi2ZwGbZa5pEeiFaKWxhSVXVGqu1L9_SioyUOk,4513
466
466
  mxcubecore/utils/qt_import.py,sha256=hQkBVZLUDZtktX7DSyoH88GAK_mK9Ghlsj4k9pFJeAQ,14415
467
467
  mxcubecore/utils/units.py,sha256=2D1QlTwe8eSs2UYRm4VVxSTosZZHeM-Pfw9KlcLbDAg,1251
468
- mxcubecore-1.339.0.dist-info/COPYING,sha256=u-Mc8zCecwyo4YoP8UulmzCiZZ_MmCLROd_NBtOcRj0,35148
469
- mxcubecore-1.339.0.dist-info/COPYING.LESSER,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
470
- mxcubecore-1.339.0.dist-info/METADATA,sha256=cpMWyoLZHQSdfAW6QBq1Vhuhbowu5hMWqBZ1hqOz-V8,4262
471
- mxcubecore-1.339.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
472
- mxcubecore-1.339.0.dist-info/RECORD,,
468
+ mxcubecore-1.341.0.dist-info/COPYING,sha256=u-Mc8zCecwyo4YoP8UulmzCiZZ_MmCLROd_NBtOcRj0,35148
469
+ mxcubecore-1.341.0.dist-info/COPYING.LESSER,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
470
+ mxcubecore-1.341.0.dist-info/METADATA,sha256=QiP1KW6bLixc0er0-IlhH_BVw0XkhkKQTx4iiAhzrhU,4262
471
+ mxcubecore-1.341.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
472
+ mxcubecore-1.341.0.dist-info/RECORD,,