MultiPyVu 3.1.1__tar.gz → 3.2.0__tar.gz

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.
Files changed (60) hide show
  1. {multipyvu-3.1.1/src/MultiPyVu.egg-info → multipyvu-3.2.0}/PKG-INFO +9 -2
  2. {multipyvu-3.1.1 → multipyvu-3.2.0}/README.md +8 -0
  3. {multipyvu-3.1.1 → multipyvu-3.2.0}/setup.py +0 -1
  4. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/BRT.py +1 -1
  5. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/CommandChamber.py +1 -1
  6. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/CommandField.py +2 -2
  7. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/CommandMultiVu.py +4 -4
  8. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/CommandSdo.py +59 -61
  9. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/CommandTemperature.py +3 -3
  10. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/CommandWaitFor.py +11 -11
  11. multipyvu-3.2.0/src/MultiPyVu/GetRunningProcesses.py +28 -0
  12. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/ICommand.py +3 -3
  13. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/ParseInputs.py +2 -2
  14. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/SocketMessage.py +7 -7
  15. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/__init__.py +7 -7
  16. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/__main__.py +1 -1
  17. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/__version.py +1 -1
  18. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/exceptions.py +2 -2
  19. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/generate_sdo_objects.py +1 -1
  20. multipyvu-3.2.0/src/MultiPyVu/gui/__init__.py +0 -0
  21. multipyvu-3.2.0/src/MultiPyVu/images/__init__.py +0 -0
  22. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/instrument.py +25 -25
  23. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/logging_config.py +6 -2
  24. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/project_vars.py +2 -2
  25. multipyvu-3.2.0/src/MultiPyVu/scripts/__init__.py +0 -0
  26. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/scripts/helper_scripts.py +2 -2
  27. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/sdo_object.py +37 -1
  28. {multipyvu-3.1.1 → multipyvu-3.2.0/src/MultiPyVu.egg-info}/PKG-INFO +9 -2
  29. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu.egg-info/SOURCES.txt +4 -0
  30. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu.egg-info/requires.txt +0 -1
  31. {multipyvu-3.1.1 → multipyvu-3.2.0}/LICENSE +0 -0
  32. {multipyvu-3.1.1 → multipyvu-3.2.0}/pyproject.toml +0 -0
  33. {multipyvu-3.1.1 → multipyvu-3.2.0}/setup.cfg +0 -0
  34. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/Command_factory.py +0 -0
  35. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/IEventManager.py +0 -0
  36. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/IServer.py +1 -1
  37. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/MultiVuClient.py +16 -16
  38. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/MultiVuClient_base.py +9 -9
  39. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/MultiVuDataFile/MultiVuDataFile.py +0 -0
  40. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/MultiVuDataFile/__init__.py +0 -0
  41. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/MultiVuDataFile/__version.py +0 -0
  42. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/MultiVuDataFile/is_pathname_valid.py +0 -0
  43. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/MultiVuServer.py +12 -12
  44. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/SocketMessageClient.py +4 -4
  45. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/SocketMessageServer.py +10 -10
  46. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/check_windows_esc.py +0 -0
  47. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/font/Play-Bold.ttf +0 -0
  48. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/font/Play-Regular.ttf +0 -0
  49. {multipyvu-3.1.1/src/MultiPyVu/gui → multipyvu-3.2.0/src/MultiPyVu/font}/__init__.py +0 -0
  50. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/gui/Controller.py +7 -7
  51. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/gui/IController.py +0 -0
  52. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/gui/IView.py +0 -0
  53. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/gui/ViewFactory.py +0 -0
  54. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/gui/ViewTk.py +3 -3
  55. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/images/Q.png +0 -0
  56. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/images/QD_logo.jpg +0 -0
  57. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/logging_config.yaml +0 -0
  58. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu/scripts/whats_my_ip_address.cmd +0 -0
  59. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu.egg-info/dependency_links.txt +0 -0
  60. {multipyvu-3.1.1 → multipyvu-3.2.0}/src/MultiPyVu.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MultiPyVu
3
- Version: 3.1.1
3
+ Version: 3.2.0
4
4
  Summary: Control MultiVu using Python
5
5
  Author-email: Damon D Jackson <djackson@qdusa.com>
6
6
  Maintainer-email: "Quantum Design, Inc." <apps@qdusa.com>
@@ -38,7 +38,6 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
38
38
  Requires-Python: >=3.8
39
39
  Description-Content-Type: text/markdown
40
40
  License-File: LICENSE
41
- Requires-Dist: typing
42
41
  Requires-Dist: pandas
43
42
  Requires-Dist: pywin32>=300; platform_system == "Windows"
44
43
  Requires-Dist: pillow
@@ -436,6 +435,14 @@ client = mpv.Client(port=6000)
436
435
  - A log file named QdMultiVu.log shows the traffic between the server and client which can also be useful during troubleshooting.
437
436
 
438
437
  ## Changelog<a class="anchor" id="changelog"></a>
438
+ **3.2.0**
439
+ - November 2024
440
+ - Improvements in determining the running version of MultiVu.
441
+
442
+ **3.1.2**
443
+ - October 2024
444
+ - Fixed a bug which truncated numbers
445
+
439
446
  **3.1.1**
440
447
  - October 2024
441
448
  - Updated the installer to include missing files.
@@ -390,6 +390,14 @@ client = mpv.Client(port=6000)
390
390
  - A log file named QdMultiVu.log shows the traffic between the server and client which can also be useful during troubleshooting.
391
391
 
392
392
  ## Changelog<a class="anchor" id="changelog"></a>
393
+ **3.2.0**
394
+ - November 2024
395
+ - Improvements in determining the running version of MultiVu.
396
+
397
+ **3.1.2**
398
+ - October 2024
399
+ - Fixed a bug which truncated numbers
400
+
393
401
  **3.1.1**
394
402
  - October 2024
395
403
  - Updated the installer to include missing files.
@@ -53,7 +53,6 @@ setup(
53
53
  },
54
54
  python_requires=">=3.8",
55
55
  install_requires=[
56
- "typing",
57
56
  "pandas",
58
57
  "pywin32>=300; platform_system=='Windows'",
59
58
  "pillow",
@@ -2,8 +2,8 @@
2
2
  BRT.py is an abstraction of the BRT module.
3
3
  """
4
4
 
5
- from typing import Tuple
6
5
  import time
6
+ from typing import Tuple
7
7
 
8
8
  from .sdo_object import SdoObject, val_type
9
9
 
@@ -11,6 +11,7 @@ from abc import abstractmethod
11
11
  from enum import IntEnum
12
12
  from typing import Union, Dict, Tuple, List
13
13
 
14
+ from .exceptions import MultiPyVuError
14
15
  from .ICommand import (ICommand,
15
16
  ICommandImp,
16
17
  ISimulateChange,
@@ -18,7 +19,6 @@ from .ICommand import (ICommand,
18
19
  catch_thread_error,
19
20
  )
20
21
  from .IEventManager import IObserver
21
- from .exceptions import MultiPyVuError
22
22
 
23
23
 
24
24
  class modeEnum(IntEnum):
@@ -7,12 +7,13 @@ Created on Tue May 18 13:14:28 2021
7
7
  @author: djackson
8
8
  """
9
9
 
10
+ from abc import abstractmethod
10
11
  import time
11
12
  from enum import IntEnum
12
- from abc import abstractmethod
13
13
  from typing import Union, Dict, Tuple, List
14
14
 
15
15
  from .check_windows_esc import _check_windows_esc
16
+ from .exceptions import MultiPyVuError
16
17
  from .ICommand import (ICommand,
17
18
  ICommandImp,
18
19
  ISimulateChange,
@@ -21,7 +22,6 @@ from .ICommand import (ICommand,
21
22
  )
22
23
  from .IEventManager import IObserver
23
24
  from .project_vars import CLOCK_TIME
24
- from .exceptions import MultiPyVuError
25
25
 
26
26
 
27
27
  class ApproachEnum(IntEnum):
@@ -10,14 +10,14 @@ Created on Sat June 12 17:35:28 2021
10
10
  @author: djackson
11
11
  """
12
12
 
13
- from sys import platform
13
+ import logging
14
14
  from abc import abstractmethod
15
+ from sys import platform
15
16
  from typing import Tuple, Dict
16
- import logging
17
17
 
18
+ from .exceptions import MultiPyVuError, PythoncomImportError
18
19
  from .ICommand import ICommand
19
20
  from .project_vars import SERVER_NAME
20
- from .exceptions import MultiPyVuError, PythoncomImportError
21
21
 
22
22
 
23
23
  if platform == 'win32':
@@ -110,7 +110,7 @@ class CommandMultiVuBase():
110
110
  msg += 'which could mean MultiVu is not running.'
111
111
  raise MultiPyVuError(msg)
112
112
 
113
- result_string = result if isinstance(result, str) else f'{result:.4f}'
113
+ result_string = result if isinstance(result, str) else str(result)
114
114
  return f'{result_string},{mv_command.units},{code_in_words}'
115
115
 
116
116
  def set_state(self, command: str, arg_string: str) -> str:
@@ -4,11 +4,11 @@ CommandSdo.py is used to read and write SDOs
4
4
  @author: djackson
5
5
  """
6
6
 
7
- from sys import platform
8
7
  import struct
9
8
  import re
10
9
  import logging
11
10
  from abc import abstractmethod
11
+ from sys import platform
12
12
  from typing import Union, Tuple, Dict
13
13
 
14
14
  from .exceptions import (MultiPyVuError,
@@ -16,11 +16,11 @@ from .exceptions import (MultiPyVuError,
16
16
  CanError,
17
17
  can_err_enum,
18
18
  abort_err_enum,
19
+ PythoncomImportError
19
20
  )
20
21
  from .ICommand import ICommand
21
- from .sdo_object import SdoObject, val_type
22
22
  from .project_vars import SERVER_NAME, CLIENT_NAME
23
- from .exceptions import PythoncomImportError
23
+ from .sdo_object import SdoObject, val_type
24
24
 
25
25
 
26
26
  if platform == 'win32':
@@ -157,8 +157,8 @@ class CommandSdoBase(ICommand):
157
157
 
158
158
  @abstractmethod
159
159
  def get_state_server(self,
160
- statusCode: str,
161
- stateValue: str,
160
+ value_variant,
161
+ state_variant,
162
162
  params: str = ''):
163
163
  raise NotImplementedError
164
164
 
@@ -187,7 +187,10 @@ class CommandSdoImp(CommandSdoBase):
187
187
  super().__init__()
188
188
  self._mvu = multivu_win32com
189
189
 
190
- def _binary_to_value(self, sdo, len, val) -> Union[str, int, float]:
190
+ def _binary_to_value(self,
191
+ sdo: SdoObject,
192
+ length: win32.VARIANT,
193
+ val: win32.VARIANT) -> Union[str, int, float]:
191
194
  """
192
195
  Convert a binary value from reading an SDO into its correct
193
196
  type.
@@ -195,9 +198,9 @@ class CommandSdoImp(CommandSdoBase):
195
198
  Parameters:
196
199
  -----------
197
200
  sdo: SdoObject
198
- len: win32com.client.VARIANT
201
+ length: win32com.client.VARIANT
199
202
  This is the parameter used in ReadSDO which
200
- holds the length of the value being read.
203
+ holds the length of the value that was read.
201
204
  val: win32com.client.VARIANT
202
205
  This is the parameter used in ReadSDO which
203
206
  holds the value being read.
@@ -208,31 +211,34 @@ class CommandSdoImp(CommandSdoBase):
208
211
  python format of string, int, or float.
209
212
  """
210
213
  if sdo.val_type is val_type.string_t:
211
- var_memory = val.value[0:len.value - 1]
214
+ var_memory = val.value[0:length.value - 1]
212
215
  return_val = bytes(var_memory).decode('utf-8')
213
- elif sdo.val_type is val_type.short_t or \
214
- sdo.val_type is val_type.int_t or \
215
- sdo.val_type is val_type.long_t:
216
- b = list(bytes(val.value)[0:len.value])
216
+ elif sdo.val_type in (val_type.short_t,
217
+ val_type.int_t,
218
+ val_type.long_t):
219
+ b = list(bytes(val.value)[0:length.value])
217
220
  return_val = int.from_bytes(b,
218
221
  byteorder='little',
219
222
  signed=True)
220
- elif sdo.val_type is val_type.ushort_t or \
221
- sdo.val_type is val_type.uint_t or \
222
- sdo.val_type is val_type.ulong_t:
223
- b = list(bytes(val.value)[0:len.value])
223
+ elif sdo.val_type in (val_type.ushort_t,
224
+ val_type.uint_t,
225
+ val_type.ulong_t):
226
+ b = list(bytes(val.value)[0:length.value])
224
227
  return_val = int.from_bytes(b,
225
228
  byteorder='little',
226
229
  signed=False)
227
- else:
228
- b = bytes(val.value)[0:len.value]
230
+ elif sdo.val_type in (val_type.single_t,
231
+ val_type.double_t):
232
+ b = bytes(val.value)[0:length.value]
229
233
  # format = '<f' means little endian ('>f' is big endian)
230
234
  [return_val] = struct.unpack('<f', b)
235
+ else:
236
+ raise ValueError('unsupported variant type')
231
237
  return return_val
232
238
 
233
239
  def _value_to_binary(self,
234
240
  sdo: SdoObject,
235
- val: Union[str, int, float]) -> Tuple[int, bytes]:
241
+ val: Union[str, int, float]) -> bytes:
236
242
  """
237
243
  Convert a value being sent to WriteSDO into binary.
238
244
 
@@ -245,41 +251,24 @@ class CommandSdoImp(CommandSdoBase):
245
251
 
246
252
  Returns:
247
253
  --------
248
- A tuple with the first item being the length of the SDO,
249
- and the second item the value being set in binary.
254
+ The value being set in binary.
250
255
  """
251
- len = 1
256
+ sdo_length = sdo.object_length()
252
257
  sdo_val = b''
253
- if sdo.val_type is val_type.short_t or \
254
- sdo.val_type is val_type.ushort_t:
255
- len = 1
256
- sdo_val = int.to_bytes(int(val), len,
257
- byteorder='little',
258
- signed=False)
259
- elif sdo.val_type is val_type.int_t or \
260
- sdo.val_type is val_type.uint_t:
261
- len = 2
262
- sdo_val = int.to_bytes(int(val), len,
263
- byteorder='little',
264
- signed=False)
265
- elif sdo.val_type is val_type.long_t or \
266
- sdo.val_type is val_type.ulong_t:
267
- len = 4
268
- sdo_val = int.to_bytes(int(val), len,
269
- byteorder='little',
270
- signed=False)
271
- elif sdo.val_type is val_type.single_t:
272
- len = 2
273
- sdo_val = struct.pack('<f', float(val))
274
- elif sdo.val_type is val_type.double_t:
275
- len = 4
258
+ if sdo.val_type in (val_type.short_t, val_type.ushort_t):
259
+ sdo_val = int(val).to_bytes(sdo_length, 'little', signed=False)
260
+ elif sdo.val_type in (val_type.int_t, val_type.uint_t):
261
+ sdo_val = int(val).to_bytes(sdo_length, 'little', signed=False)
262
+ elif sdo.val_type in (val_type.long_t, val_type.ulong_t):
263
+ sdo_val = int(val).to_bytes(sdo_length, 'little', signed=False)
264
+ elif sdo.val_type in (val_type.single_t, val_type.double_t):
276
265
  sdo_val = struct.pack('<f', float(val))
277
266
  elif sdo.val_type is val_type.string_t:
278
267
  sdo_val = val.encode()
279
268
  else:
280
269
  msg = 'Unsupported val_type: ' + str(sdo)
281
270
  raise ValueError(msg)
282
- return len, sdo_val
271
+ return sdo_val
283
272
 
284
273
  def read_sdo(self, sdo: SdoObject,) -> Tuple:
285
274
  """
@@ -296,7 +285,7 @@ class CommandSdoImp(CommandSdoBase):
296
285
  a tuple whose first term is the CAN error and the second
297
286
  term is the abort error.
298
287
  """
299
- sdo_len = win32.VARIANT(
288
+ length_variant = win32.VARIANT(
300
289
  pythoncom.VT_BYREF | pythoncom.VT_I4,
301
290
  0)
302
291
  value_variant = win32.VARIANT(
@@ -311,7 +300,7 @@ class CommandSdoImp(CommandSdoBase):
311
300
  can_error = self._mvu.ReadSDO(sdo.node,
312
301
  sdo.index,
313
302
  sdo.sub,
314
- sdo_len,
303
+ length_variant,
315
304
  value_variant,
316
305
  error_variant)
317
306
  self.return_state = self._errors_to_str(can_error,
@@ -327,7 +316,9 @@ class CommandSdoImp(CommandSdoBase):
327
316
  msg += f'while reading ({str(sdo)})'
328
317
  raise MultiPyVuError(msg)
329
318
  else:
330
- return_val = self._binary_to_value(sdo, sdo_len, value_variant)
319
+ return_val = self._binary_to_value(sdo,
320
+ length_variant,
321
+ value_variant)
331
322
 
332
323
  return return_val, self.return_state
333
324
 
@@ -348,13 +339,11 @@ class CommandSdoImp(CommandSdoBase):
348
339
  --------
349
340
  string with the error from MultiVu
350
341
  """
351
- len, sdo_val = self._value_to_binary(sdo, val)
352
- sdo_len = win32.VARIANT(
353
- pythoncom.VT_BYREF | pythoncom.VT_I4,
354
- len)
342
+ binary_val = self._value_to_binary(sdo, val)
343
+ data_length = sdo.object_length()
355
344
  value_variant = win32.VARIANT(
356
345
  pythoncom.VT_BYREF | pythoncom.VT_VARIANT,
357
- sdo_val)
346
+ binary_val)
358
347
  error_variant = win32.VARIANT(
359
348
  pythoncom.VT_BYREF | pythoncom.VT_I4,
360
349
  0)
@@ -363,7 +352,7 @@ class CommandSdoImp(CommandSdoBase):
363
352
  can_error = self._mvu.WriteSDO(sdo.node,
364
353
  sdo.index,
365
354
  sdo.sub,
366
- sdo_len,
355
+ data_length,
367
356
  value_variant,
368
357
  error_variant)
369
358
  self.return_state = self._errors_to_str(can_error,
@@ -379,14 +368,20 @@ class CommandSdoImp(CommandSdoBase):
379
368
  self.logger_client.debug(msg)
380
369
  return self.return_state
381
370
 
382
- def get_state_server(self, value_variant, state_variant, params) -> Tuple:
371
+ def get_state_server(self,
372
+ value_variant,
373
+ state_variant,
374
+ params: str) -> Tuple:
383
375
  """
384
376
  Returns a tuple of the SDO query result and the can_error number.
385
377
 
378
+ Note that the first two input parameters are unused, but included
379
+ because the other CommandXXX classes use them.
380
+
386
381
  Parameters:
387
382
  -----------
388
- value_variant: win32com.client (not used)
389
- state_variant: win32com.client (not used)
383
+ value_variant: (not used)
384
+ state_variant: (not used)
390
385
  params: str
391
386
  The string representation of an sdo_object
392
387
 
@@ -434,10 +429,13 @@ class CommandSdoSim(CommandSdoBase):
434
429
  """
435
430
  Returns a tuple of the SDO query result and the can_error number.
436
431
 
432
+ Note that the first two input parameters are unused, but included
433
+ because the other CommandXXX classes use them.
434
+
437
435
  Parameters:
438
436
  -----------
439
- value_variant: win32com.client (not used)
440
- state_variant: win32com.client (not used)
437
+ value_variant: (not used)
438
+ state_variant: (not used)
441
439
  params: str
442
440
  The string representation of an SdoObject
443
441
 
@@ -7,12 +7,13 @@ Created on Tue May 18 13:14:28 2021
7
7
  @author: djackson
8
8
  """
9
9
 
10
- from enum import IntEnum
11
10
  import time
12
- from typing import Union, Tuple, Dict, List
13
11
  from abc import abstractmethod
12
+ from enum import IntEnum
13
+ from typing import Union, Tuple, Dict, List
14
14
 
15
15
  from .check_windows_esc import _check_windows_esc
16
+ from .exceptions import MultiPyVuError
16
17
  from .ICommand import (ICommand,
17
18
  ICommandImp,
18
19
  ISimulateChange,
@@ -21,7 +22,6 @@ from .ICommand import (ICommand,
21
22
  )
22
23
  from .IEventManager import IObserver
23
24
  from .project_vars import CLOCK_TIME
24
- from .exceptions import MultiPyVuError
25
25
 
26
26
 
27
27
  class ApproachEnum(IntEnum):
@@ -6,27 +6,27 @@ Created on Tue May 18 13:14:28 2021
6
6
  @author: djackson
7
7
  """
8
8
 
9
- from sys import platform
10
- from enum import IntEnum
11
9
  import time
12
- from typing import Union, Tuple, Dict, List
13
10
  from abc import abstractmethod
11
+ from enum import IntEnum
12
+ from sys import platform
13
+ from typing import Union, Tuple, Dict, List
14
14
 
15
15
  from .check_windows_esc import _check_windows_esc
16
- from .IEventManager import IObserver
17
- from .ICommand import (ICommand,
18
- ICommandImp,
19
- ISimulateChange
20
- )
21
- from .CommandTemperature import SimulateTemperatureChange
22
- from .CommandField import SimulateFieldChange
23
16
  from .CommandChamber import SimulateChamberChange
24
- from .project_vars import CLOCK_TIME
17
+ from .CommandField import SimulateFieldChange
18
+ from .CommandTemperature import SimulateTemperatureChange
25
19
  from .exceptions import (MultiPyVuError,
26
20
  PythoncomImportError,
27
21
  CanError,
28
22
  can_err_enum,
29
23
  )
24
+ from .IEventManager import IObserver
25
+ from .ICommand import (ICommand,
26
+ ICommandImp,
27
+ ISimulateChange
28
+ )
29
+ from .project_vars import CLOCK_TIME
30
30
 
31
31
  if platform == 'win32':
32
32
  try:
@@ -0,0 +1,28 @@
1
+ '''
2
+ This script gets a list of running processes
3
+ '''
4
+
5
+ import win32process
6
+ import win32api
7
+ from os import path
8
+
9
+
10
+ search_keyword = "MultiVu"
11
+
12
+ # Get a list of all running processes
13
+ pids = win32process.EnumProcesses()
14
+
15
+ for pid in pids:
16
+ try:
17
+ # Open processes to query its executable path
18
+ h_process = win32api.OpenProcess(0x0410, False, pid)
19
+ exe_path = win32process.GetModuleFileNameEx(h_process, 0)
20
+ win32api.CloseHandle(h_process)
21
+
22
+ # Check if the path contains the keyword
23
+ if search_keyword.lower() in exe_path.lower():
24
+ exe_name = path.basename(exe_path)
25
+ print(f"PID: {pid}, Executable Path: {exe_path}, exe name: {exe_name}")
26
+ except Exception:
27
+ # Ignore processes that we don't have access to
28
+ pass
@@ -13,15 +13,15 @@ Created on Tue May 18 12:59:24 2021
13
13
  @author: djackson
14
14
  """
15
15
 
16
- from sys import platform
17
- from typing import Union, Dict, Tuple, Type
18
16
  from abc import ABC, abstractmethod
17
+ from sys import platform
19
18
  from threading import Thread, Lock, enumerate
20
19
  from time import time, sleep
20
+ from typing import Union, Dict, Tuple, Type
21
21
 
22
+ from .exceptions import PythoncomImportError
22
23
  from .IEventManager import Publisher, IObserver
23
24
  from .project_vars import CLOCK_TIME
24
- from .exceptions import PythoncomImportError
25
25
 
26
26
  if platform == 'win32':
27
27
  try:
@@ -5,9 +5,9 @@ command-line inputs
5
5
 
6
6
  """
7
7
 
8
- import sys
9
- import re
10
8
  import ntpath
9
+ import re
10
+ import sys
11
11
  from typing import List
12
12
 
13
13
  from .instrument import InstrumentList
@@ -8,21 +8,21 @@ Created on Mon Jun 7 23:47:19 2021
8
8
  @author: D. Jackson
9
9
  """
10
10
 
11
- import sys
12
- from abc import ABC
13
- import socket
14
- import json
15
11
  import io
12
+ import json
16
13
  import logging
17
- import struct
18
14
  import re
15
+ import socket
16
+ import struct
17
+ import sys
18
+ from abc import ABC
19
19
  from typing import Union, Dict, Tuple
20
20
 
21
- from .project_vars import PORT
21
+ from .__version import __version__ as mpv_version
22
22
  from .exceptions import (ClientCloseError,
23
23
  SocketError,
24
24
  )
25
- from .__version import __version__ as mpv_version
25
+ from .project_vars import PORT
26
26
 
27
27
 
28
28
  class Message(ABC):
@@ -22,25 +22,25 @@ Import MultiPyVu as mpv
22
22
  @author: Damon D Jackson
23
23
  """
24
24
 
25
- from sys import exc_info
26
- from os import path
27
25
  import traceback
28
- from pandas import DataFrame
29
26
  from enum import IntEnum as _IntEnum
30
27
  from enum import auto as _auto
28
+ from os import path
29
+ from pandas import DataFrame
30
+ from sys import exc_info
31
31
  from typing import Union
32
32
 
33
33
  from .__version import __version__
34
- from .MultiVuServer import Server
34
+ from .exceptions import MultiPyVuError, SocketError
35
35
  from .MultiVuClient import Client
36
+ from .MultiVuDataFile.MultiVuDataFile import LabelResult
36
37
  from .MultiVuDataFile.MultiVuDataFile import MultiVuDataFile as _MultiVuDataFile
38
+ from .MultiVuDataFile.MultiVuDataFile import MultiVuFileException
37
39
  from .MultiVuDataFile.MultiVuDataFile import TScaleType as _TScaleType
38
40
  from .MultiVuDataFile.MultiVuDataFile import TStartupAxisType as _TStartupAxisType
39
41
  from .MultiVuDataFile.MultiVuDataFile import TTimeUnits as _TTimeUnits
40
42
  from .MultiVuDataFile.MultiVuDataFile import TTimeMode as _TTimeMode
41
- from .MultiVuDataFile.MultiVuDataFile import LabelResult
42
- from .MultiVuDataFile.MultiVuDataFile import MultiVuFileException
43
- from .exceptions import MultiPyVuError, SocketError
43
+ from .MultiVuServer import Server
44
44
 
45
45
 
46
46
  __version__ = __version__
@@ -17,11 +17,11 @@ For example:
17
17
  from sys import argv
18
18
 
19
19
  from MultiPyVu.gui.Controller import Controller
20
+ from MultiPyVu.ParseInputs import parse_input
20
21
  from MultiPyVu.scripts.helper_scripts import (get_ip,
21
22
  run_status,
22
23
  is_running,
23
24
  force_quit)
24
- from MultiPyVu.ParseInputs import parse_input
25
25
 
26
26
 
27
27
  def run_gui():
@@ -1,2 +1,2 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "3.1.1"
2
+ __version__ = "3.2.0"
@@ -3,8 +3,8 @@ Custom exceptions for MultiPyVu
3
3
  """
4
4
 
5
5
 
6
- from sys import exit, platform
7
6
  from enum import IntEnum
7
+ from sys import exit, platform
8
8
  from typing import Tuple
9
9
 
10
10
 
@@ -364,5 +364,5 @@ class CanError(Exception):
364
364
  if can_err == can_err_enum.R_ABORT:
365
365
  err_msg, _ = abort_error_msg(sdo_err)
366
366
  if can_err != can_err_enum.R_OK:
367
- err_msg = 'Error: ' + err_msg
367
+ err_msg = 'CAN Error: ' + err_msg
368
368
  super().__init__(err_msg)
@@ -10,9 +10,9 @@ in the same location as the cop file and will have the same
10
10
  name with the .py ending.
11
11
  """
12
12
 
13
- from sys import argv, exit
14
13
  import os.path
15
14
  import re
15
+ from sys import argv, exit
16
16
 
17
17
  from MultiPyVu.CommandSdo import SdoObject, val_type
18
18
 
File without changes
File without changes
@@ -8,22 +8,23 @@ Created on Tue May 18 13:14:28 2021
8
8
  @author: djackson
9
9
  """
10
10
 
11
- from sys import platform
12
- import subprocess
13
- import time
14
- import re
15
11
  import logging
12
+ import time
16
13
  from enum import Enum, auto
14
+ from os import path
15
+ from sys import platform
17
16
  from typing import Tuple
18
17
 
19
- from .project_vars import SERVER_NAME, PYWIN32_VERSION, MIN_PYWIN32_VERSION
20
18
  from .exceptions import MultiPyVuError, PythoncomImportError
21
19
  from .__version import __version__ as mpv_version
20
+ from .project_vars import SERVER_NAME, PYWIN32_VERSION, MIN_PYWIN32_VERSION
22
21
 
23
22
  if platform == 'win32':
24
23
  try:
25
24
  import pythoncom
26
25
  import win32com.client as win32
26
+ import win32api
27
+ import win32process
27
28
  except ImportError:
28
29
  raise PythoncomImportError
29
30
 
@@ -218,28 +219,27 @@ class Instrument():
218
219
  # declare these variables so that they are available to return
219
220
  common_name = ''
220
221
  exe_name = ''
222
+ open_mv_dict = {}
221
223
 
222
- # Use WMIC to get the list of running programs with 'multivu'
223
- # in their path
224
- cmd = 'WMIC PROCESS WHERE "COMMANDLINE like \'%multivu%\'" GET '
225
- cmd += 'Caption,Commandline,Processid'
226
- proc = subprocess.run(cmd, capture_output=True, text=True)
227
- if proc.returncode != 0:
228
- raise Exception(proc.stderr)
229
- # make a dictionary whose key is the MultiVu flavor, and the
224
+ # Find processes with 'MultiVu' in the name and make
225
+ # a dictionary whose key is the MultiVu flavor, and the
230
226
  # value is a tuple with the exe path and process id
231
- exe_search = r'([\w]*).exe[ ]*\"([:\\\w]*.exe)"[ \/\-a-zA-Z]*([0-9]*)'
232
- open_mv_dict = {}
233
- for i in proc.stdout.split('\n\n'):
234
- exe_found = re.findall(exe_search, i)
235
- if len(exe_found) > 0:
236
- name, location, process_id = exe_found[0]
237
- exe_name = name + '.exe'
238
- common_name = self._exe_to_common_name(exe_name)
239
- open_mv_dict[common_name] = (location,
240
- exe_name,
241
- process_id,
242
- )
227
+ pids = win32process.EnumProcesses()
228
+ for pid in pids:
229
+ try:
230
+ # Open processes to query its executable path
231
+ h_process = win32api.OpenProcess(0x0410, False, pid)
232
+ exe_path = win32process.GetModuleFileNameEx(h_process, 0)
233
+ win32api.CloseHandle(h_process)
234
+
235
+ # Check if the path contains the keyword
236
+ if 'multivu' in exe_path.lower():
237
+ exe_name = path.basename(exe_path)
238
+ common_name = self._exe_to_common_name(exe_name)
239
+ open_mv_dict[common_name] = (exe_path, exe_name)
240
+ except Exception:
241
+ # Ignore processes that we don't have access to
242
+ pass
243
243
 
244
244
  # Declare errors if no MultiVu instance is found
245
245
  if len(open_mv_dict) == 0:
@@ -1,7 +1,11 @@
1
- from os import path
1
+ '''
2
+ loggin_config.py is used to hold methods to help with the logging module
3
+ '''
4
+
2
5
  import logging.config
3
- from logging import Logger
4
6
  import yaml
7
+ from logging import Logger
8
+ from os import path
5
9
 
6
10
  from .project_vars import LOG_NAME
7
11
 
@@ -7,9 +7,9 @@ Created on Mon Sep 27 10:53:06 2021
7
7
  @author: D. Jackson
8
8
  """
9
9
 
10
- from sys import platform
11
- import os
12
10
  import distutils.sysconfig
11
+ import os
12
+ from sys import platform
13
13
 
14
14
  from .exceptions import PythoncomImportError
15
15
 
File without changes
@@ -2,10 +2,10 @@
2
2
  A few helpful scripts used in the MultiPyVu module
3
3
  """
4
4
 
5
+ import re
6
+ import subprocess
5
7
  from os import path
6
8
  from sys import platform
7
- import subprocess
8
- import re
9
9
 
10
10
  from MultiPyVu.MultiVuClient import Client
11
11
 
@@ -37,6 +37,17 @@ class SdoObject():
37
37
  The string can be converted into an sdo_object by calling
38
38
  .str_to_obj(string), which is a static method and returns
39
39
  an sdo_object.
40
+
41
+ Parameters:
42
+ -----------
43
+ nodID: int
44
+ The node number
45
+ sdo_index: int
46
+ This should be represented in hex. For example, 0x1008.
47
+ sub_index: int
48
+ This should be represented in hex. For example, 0x0.
49
+ val_t: val_type
50
+ Specify the type.
40
51
  """
41
52
  def __init__(self,
42
53
  nodeID: int,
@@ -44,7 +55,7 @@ class SdoObject():
44
55
  sub_index: int,
45
56
  val_t: val_type):
46
57
  if (nodeID > 63) or (nodeID < 0):
47
- msg = f'Invalid nodeNum: {nodeID}'
58
+ msg = f'Invalid nodeID: {nodeID}'
48
59
  raise ValueError(msg)
49
60
  if (sdo_index > 0xFFFF) or (sdo_index < 0):
50
61
  msg = f'Invalid SDO index: {sdo_index}'
@@ -99,3 +110,28 @@ class SdoObject():
99
110
  s = int(sub_index, 16)
100
111
  v_t = val_type[t]
101
112
  return SdoObject(n, i, s, v_t)
113
+
114
+ def object_length(self) -> int:
115
+ """
116
+ Get the byte size
117
+ """
118
+ if self.val_type is val_type.short_t:
119
+ return 1
120
+ elif self.val_type is val_type.int_t:
121
+ return 2
122
+ elif self.val_type is val_type.single_t:
123
+ return 2
124
+ elif self.val_type is val_type.string_t:
125
+ return 1
126
+ elif self.val_type is val_type.ushort_t:
127
+ return 1
128
+ elif self.val_type is val_type.uint_t:
129
+ return 2
130
+ elif self.val_type is val_type.double_t:
131
+ return 4
132
+ elif self.val_type is val_type.long_t:
133
+ return 4
134
+ elif self.val_type is val_type.ulong_t:
135
+ return 4
136
+ else:
137
+ raise ValueError('Unimplemented SDO type')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MultiPyVu
3
- Version: 3.1.1
3
+ Version: 3.2.0
4
4
  Summary: Control MultiVu using Python
5
5
  Author-email: Damon D Jackson <djackson@qdusa.com>
6
6
  Maintainer-email: "Quantum Design, Inc." <apps@qdusa.com>
@@ -38,7 +38,6 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
38
38
  Requires-Python: >=3.8
39
39
  Description-Content-Type: text/markdown
40
40
  License-File: LICENSE
41
- Requires-Dist: typing
42
41
  Requires-Dist: pandas
43
42
  Requires-Dist: pywin32>=300; platform_system == "Windows"
44
43
  Requires-Dist: pillow
@@ -436,6 +435,14 @@ client = mpv.Client(port=6000)
436
435
  - A log file named QdMultiVu.log shows the traffic between the server and client which can also be useful during troubleshooting.
437
436
 
438
437
  ## Changelog<a class="anchor" id="changelog"></a>
438
+ **3.2.0**
439
+ - November 2024
440
+ - Improvements in determining the running version of MultiVu.
441
+
442
+ **3.1.2**
443
+ - October 2024
444
+ - Fixed a bug which truncated numbers
445
+
439
446
  **3.1.1**
440
447
  - October 2024
441
448
  - Updated the installer to include missing files.
@@ -10,6 +10,7 @@ src/MultiPyVu/CommandSdo.py
10
10
  src/MultiPyVu/CommandTemperature.py
11
11
  src/MultiPyVu/CommandWaitFor.py
12
12
  src/MultiPyVu/Command_factory.py
13
+ src/MultiPyVu/GetRunningProcesses.py
13
14
  src/MultiPyVu/ICommand.py
14
15
  src/MultiPyVu/IEventManager.py
15
16
  src/MultiPyVu/IServer.py
@@ -42,6 +43,7 @@ src/MultiPyVu/MultiVuDataFile/__version.py
42
43
  src/MultiPyVu/MultiVuDataFile/is_pathname_valid.py
43
44
  src/MultiPyVu/font/Play-Bold.ttf
44
45
  src/MultiPyVu/font/Play-Regular.ttf
46
+ src/MultiPyVu/font/__init__.py
45
47
  src/MultiPyVu/gui/Controller.py
46
48
  src/MultiPyVu/gui/IController.py
47
49
  src/MultiPyVu/gui/IView.py
@@ -50,5 +52,7 @@ src/MultiPyVu/gui/ViewTk.py
50
52
  src/MultiPyVu/gui/__init__.py
51
53
  src/MultiPyVu/images/Q.png
52
54
  src/MultiPyVu/images/QD_logo.jpg
55
+ src/MultiPyVu/images/__init__.py
56
+ src/MultiPyVu/scripts/__init__.py
53
57
  src/MultiPyVu/scripts/helper_scripts.py
54
58
  src/MultiPyVu/scripts/whats_my_ip_address.cmd
@@ -1,4 +1,3 @@
1
- typing
2
1
  pandas
3
2
  pillow
4
3
  pyyaml
File without changes
File without changes
File without changes
@@ -7,8 +7,8 @@ It requires ABCplus (Abstract Base Class plus), which is found here:
7
7
  @author: djackson
8
8
  """
9
9
 
10
- from typing import Union, Tuple
11
10
  from abc import ABC, abstractmethod
11
+ from typing import Union, Tuple
12
12
 
13
13
  from .project_vars import PORT
14
14
 
@@ -13,36 +13,36 @@ with MultiVu.
13
13
  @author: D. Jackson
14
14
  """
15
15
 
16
- from sys import exc_info
17
- from enum import IntEnum
18
16
  import traceback
17
+ from enum import IntEnum
18
+ from sys import exc_info
19
19
  from typing import Union, Tuple
20
20
 
21
- from .MultiVuClient_base import ClientBase as _ClientBase
22
- from .instrument import InstrumentList
21
+ from .BRT import Brt as _brt
23
22
  from . import Command_factory as _Command_factory
24
- from .CommandTemperature import STATE_DICT as _temperature_state_dict
25
- from .CommandTemperature import ApproachEnum as _temperature_approach_mode
26
- from .CommandTemperature import units as _temperature_units
23
+ from .CommandChamber import modeEnum as _chamber_mode
24
+ from .CommandChamber import units as _chamber_units
27
25
  from .CommandField import ApproachEnum as _field_approach_mode
28
26
  from .CommandField import drivenEnum as _field_driven_mode
29
27
  from .CommandField import units as _field_units
30
- from .CommandChamber import modeEnum as _chamber_mode
31
- from .CommandChamber import units as _chamber_units
28
+ from .CommandTemperature import STATE_DICT as _temperature_state_dict
29
+ from .CommandTemperature import ApproachEnum as _temperature_approach_mode
30
+ from .CommandTemperature import units as _temperature_units
32
31
  from .CommandWaitFor import MaskEnum as _wait_for_enum
33
- from .sdo_object import SdoObject
34
- from .sdo_object import val_type as _sdo_val_type
35
- from .BRT import Brt as _brt
36
- from .project_vars import (HOST_CLIENT,
37
- PORT,
38
- TIMEOUT_LENGTH
39
- )
40
32
  from .exceptions import (MultiPyVuError,
41
33
  ServerCloseError,
42
34
  CanError,
43
35
  can_err_enum,
44
36
  abort_err_enum,
45
37
  )
38
+ from .instrument import InstrumentList
39
+ from .MultiVuClient_base import ClientBase as _ClientBase
40
+ from .project_vars import (HOST_CLIENT,
41
+ PORT,
42
+ TIMEOUT_LENGTH
43
+ )
44
+ from .sdo_object import SdoObject
45
+ from .sdo_object import val_type as _sdo_val_type
46
46
 
47
47
 
48
48
  class Client(_ClientBase):
@@ -12,15 +12,20 @@ MultiVuClient class has specific commands to be used with this class.
12
12
  @author: D. Jackson
13
13
  """
14
14
 
15
+ import logging
15
16
  import sys
17
+ import traceback
16
18
  from socket import timeout as sock_timeout
17
19
  from time import sleep
18
- import logging
19
- import traceback
20
20
  from typing import Dict, Union
21
21
 
22
22
 
23
- from .SocketMessageClient import ClientMessage as _ClientMessage
23
+ from .__version import __version__ as mpv_version
24
+ from .exceptions import (MultiPyVuError,
25
+ ClientCloseError,
26
+ ServerCloseError,
27
+ SocketError
28
+ )
24
29
  from .logging_config import setup_logging, remove_logs
25
30
  from .project_vars import (TIMEOUT_LENGTH,
26
31
  CLIENT_NAME,
@@ -28,12 +33,7 @@ from .project_vars import (TIMEOUT_LENGTH,
28
33
  PORT,
29
34
  CLOCK_TIME,
30
35
  )
31
- from .exceptions import (MultiPyVuError,
32
- ClientCloseError,
33
- ServerCloseError,
34
- SocketError
35
- )
36
- from .__version import __version__ as mpv_version
36
+ from .SocketMessageClient import ClientMessage as _ClientMessage
37
37
 
38
38
 
39
39
  MAX_TRIES = 3
@@ -8,37 +8,37 @@ be used with MultiVuClient.py to control a Quantum Design cryostat.
8
8
  @author: D. Jackson
9
9
  """
10
10
 
11
+ import logging
12
+ import re
11
13
  import sys
12
14
  import selectors
13
- import re
14
- from time import sleep
15
- import logging
16
15
  import traceback
16
+ from time import sleep
17
17
  from typing import List, Tuple
18
18
 
19
19
 
20
- from .scripts.helper_scripts import force_quit
21
- from .IServer import IServer as _IServer
22
- from .IEventManager import IObserver as _IObserver
23
- from .SocketMessageServer import ServerMessage as _ServerMessage
24
- from .SocketMessageServer import ServerStatus as _ServerStatus
25
- from .ParseInputs import inputs_from_command_line
26
- from .instrument import Instrument as _Instrument
27
- from .CommandTemperature import SimulateTemperatureChange as _SimulateTemperatureChange
28
- from .CommandField import SimulateFieldChange as _SimulateFieldChange
29
20
  from .CommandChamber import SimulateChamberChange as _SimulateChamberChange
21
+ from .CommandField import SimulateFieldChange as _SimulateFieldChange
22
+ from .CommandTemperature import SimulateTemperatureChange as _SimulateTemperatureChange
30
23
  from .exceptions import (MultiPyVuError,
31
24
  ClientCloseError,
32
25
  ServerCloseError,
33
26
  SocketError,
34
27
  )
28
+ from .IEventManager import IObserver as _IObserver
29
+ from .IServer import IServer as _IServer
30
+ from .instrument import Instrument as _Instrument
35
31
  from .logging_config import setup_logging, remove_logs
32
+ from .ParseInputs import inputs_from_command_line
36
33
  from .project_vars import (SERVER_NAME,
37
34
  HOST_SERVER,
38
35
  PORT,
39
36
  TIMEOUT_LENGTH,
40
37
  CLOCK_TIME,
41
38
  )
39
+ from .scripts.helper_scripts import force_quit
40
+ from .SocketMessageServer import ServerMessage as _ServerMessage
41
+ from .SocketMessageServer import ServerStatus as _ServerStatus
42
42
 
43
43
 
44
44
  class Server(_IServer):
@@ -8,21 +8,21 @@ Created on Mon Jun 7 23:47:19 2021
8
8
  @author: D. Jackson
9
9
  """
10
10
 
11
- import re
12
11
  import logging
12
+ import re
13
13
  import socket
14
14
  from time import sleep
15
15
  from typing import Union, Tuple, Dict
16
16
 
17
17
  from .check_windows_esc import _check_windows_esc
18
- from .SocketMessage import Message
19
- from .instrument import Instrument
20
- from .project_vars import CLIENT_NAME, CLOCK_TIME
21
18
  from .exceptions import (MultiPyVuError,
22
19
  ClientCloseError,
23
20
  ServerCloseError,
24
21
  SocketError
25
22
  )
23
+ from .instrument import Instrument
24
+ from .project_vars import CLIENT_NAME, CLOCK_TIME
25
+ from .SocketMessage import Message
26
26
 
27
27
 
28
28
  class ClientMessage(Message):
@@ -8,23 +8,19 @@ Created on Mon Jun 7 23:47:19 2021
8
8
  @author: D. Jackson
9
9
  """
10
10
 
11
- from sys import platform
11
+ import logging
12
+ import re
13
+ import selectors
14
+ import socket
12
15
  import threading
13
- import traceback
14
16
  import time
15
- import socket
16
- import selectors
17
- import re
17
+ import traceback
18
18
  from enum import IntEnum, auto, IntFlag
19
- import logging
19
+ from sys import platform
20
20
  from typing import Union, Dict, Tuple, List
21
21
 
22
22
  from .check_windows_esc import _check_windows_esc
23
23
  from .Command_factory import create_command_mv
24
- from .SocketMessage import Message
25
- from .instrument import Instrument
26
- from .IEventManager import Publisher as _Publisher
27
- from .IEventManager import IObserver as _IObserver
28
24
  from .exceptions import (MultiPyVuError,
29
25
  ClientCloseError,
30
26
  ServerCloseError,
@@ -32,7 +28,11 @@ from .exceptions import (MultiPyVuError,
32
28
  SocketError,
33
29
  PythoncomImportError,
34
30
  )
31
+ from .IEventManager import Publisher as _Publisher
32
+ from .IEventManager import IObserver as _IObserver
33
+ from .instrument import Instrument
35
34
  from .project_vars import SERVER_NAME, CLOCK_TIME
35
+ from .SocketMessage import Message
36
36
 
37
37
 
38
38
  if platform == 'win32':
@@ -6,19 +6,19 @@ pattern for MultiPyVu.py
6
6
  """
7
7
 
8
8
 
9
+ import re
10
+ import subprocess
9
11
  import os
10
12
  from sys import platform
11
- import subprocess
12
- import re
13
- from typing import List
14
13
  from types import MethodType
14
+ from typing import List
15
15
 
16
- from ..MultiVuServer import Server
16
+ from .IController import IController
17
+ from .ViewFactory import ViewType, ViewFactory
18
+ from ..IEventManager import IObserver
17
19
  from ..instrument import InstrumentList
20
+ from ..MultiVuServer import Server
18
21
  from ..ParseInputs import inputs_from_command_line
19
- from ..IEventManager import IObserver
20
- from .ViewFactory import ViewType, ViewFactory
21
- from .IController import IController
22
22
 
23
23
 
24
24
  class ServerInfo(IObserver):
@@ -5,13 +5,13 @@ View.py holds the code for a gui for MultiPyVu.Server
5
5
  """
6
6
 
7
7
 
8
- import sys
9
8
  import io
10
- from enum import IntEnum, auto
11
- from threading import Lock
12
9
  import logging
13
10
  import logging.handlers
11
+ import sys
14
12
  import tkinter as tk
13
+ from enum import IntEnum, auto
14
+ from threading import Lock
15
15
  from tkinter import font
16
16
  try:
17
17
  from PIL import ImageTk, Image