quarchpy 2.1.24.dev1__py2.py3-none-any.whl → 2.1.24.dev2__py2.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.
Files changed (62) hide show
  1. quarchpy/.idea/.name +1 -1
  2. quarchpy/.idea/modules.xml +2 -0
  3. quarchpy/.idea/quarchpy.iml +5 -1
  4. quarchpy/.idea/workspace.xml +257 -18
  5. quarchpy/_version.py +1 -1
  6. quarchpy/connection_specific/QPS/qis/qis_lib/CInterface-1.8.0.jar +0 -0
  7. quarchpy/connection_specific/QPS/win-amd64/hs_err_pid8224.log +8905 -0
  8. quarchpy/debug/SystemTest.py +14 -3
  9. quarchpy/device/scanDevices.py +48 -22
  10. quarchpy/docs/_build/doctrees/CHANGES.doctree +0 -0
  11. quarchpy/docs/_build/doctrees/environment.pickle +0 -0
  12. quarchpy/docs/_build/doctrees/index.doctree +0 -0
  13. quarchpy/docs/_build/doctrees/readme.doctree +0 -0
  14. quarchpy/docs/_build/doctrees/source/changelog.doctree +0 -0
  15. quarchpy/docs/_build/doctrees/source/licenses.doctree +0 -0
  16. quarchpy/docs/_build/doctrees/source/modules.doctree +0 -0
  17. quarchpy/docs/_build/doctrees/source/quarchpy.calibration.doctree +0 -0
  18. quarchpy/docs/_build/doctrees/source/quarchpy.config_files.doctree +0 -0
  19. quarchpy/docs/_build/doctrees/source/quarchpy.connection_specific.doctree +0 -0
  20. quarchpy/docs/_build/doctrees/source/quarchpy.debug.doctree +0 -0
  21. quarchpy/docs/_build/doctrees/source/quarchpy.device.doctree +0 -0
  22. quarchpy/docs/_build/doctrees/source/quarchpy.disk_test.doctree +0 -0
  23. quarchpy/docs/_build/doctrees/source/quarchpy.doctree +0 -0
  24. quarchpy/docs/_build/doctrees/source/quarchpy.fio.doctree +0 -0
  25. quarchpy/docs/_build/doctrees/source/quarchpy.iometer.doctree +0 -0
  26. quarchpy/docs/_build/doctrees/source/quarchpy.qis.doctree +0 -0
  27. quarchpy/docs/_build/doctrees/source/quarchpy.qps.doctree +0 -0
  28. quarchpy/docs/_build/doctrees/source/quarchpy.user_interface.doctree +0 -0
  29. quarchpy/docs/_build/doctrees/source/quarchpy.utilities.doctree +0 -0
  30. quarchpy/docs/_build/doctrees/source/readme.doctree +0 -0
  31. quarchpy/docs/_build/html/CHANGES.html +119 -123
  32. quarchpy/docs/_build/html/_sources/CHANGES.rst.txt +0 -5
  33. quarchpy/docs/_build/html/genindex.html +1537 -0
  34. quarchpy/docs/_build/html/index.html +60 -61
  35. quarchpy/docs/_build/html/objects.inv +0 -0
  36. quarchpy/docs/_build/html/readme.html +7 -6
  37. quarchpy/docs/_build/html/searchindex.js +1 -1
  38. quarchpy/docs/_build/html/source/changelog.html +179 -184
  39. quarchpy/docs/_build/html/source/licenses.html +7 -6
  40. quarchpy/docs/_build/html/source/modules.html +43 -35
  41. quarchpy/docs/_build/html/source/quarchpy.config_files.html +12 -2
  42. quarchpy/docs/_build/html/source/quarchpy.connection_specific.html +602 -16
  43. quarchpy/docs/_build/html/source/quarchpy.debug.html +127 -8
  44. quarchpy/docs/_build/html/source/quarchpy.device.html +1003 -12
  45. quarchpy/docs/_build/html/source/quarchpy.disk_test.html +75 -9
  46. quarchpy/docs/_build/html/source/quarchpy.fio.html +67 -6
  47. quarchpy/docs/_build/html/source/quarchpy.html +539 -38
  48. quarchpy/docs/_build/html/source/quarchpy.iometer.html +156 -10
  49. quarchpy/docs/_build/html/source/quarchpy.qis.html +518 -4
  50. quarchpy/docs/_build/html/source/quarchpy.qps.html +105 -4
  51. quarchpy/docs/_build/html/source/quarchpy.user_interface.html +156 -4
  52. quarchpy/docs/_build/html/source/quarchpy.utilities.html +96 -10
  53. quarchpy/docs/_build/html/source/readme.html +7 -6
  54. quarchpy/qis/qisFuncs.py +5 -9
  55. quarchpy/run.py +0 -7
  56. {quarchpy-2.1.24.dev1.dist-info → quarchpy-2.1.24.dev2.dist-info}/METADATA +1 -1
  57. {quarchpy-2.1.24.dev1.dist-info → quarchpy-2.1.24.dev2.dist-info}/RECORD +59 -60
  58. quarchpy/.idea/inspectionProfiles/Project_Default.xml +0 -12
  59. quarchpy/__pycache__/__init__.cpython-311.pyc +0 -0
  60. quarchpy/__pycache__/_version.cpython-311.pyc +0 -0
  61. {quarchpy-2.1.24.dev1.dist-info → quarchpy-2.1.24.dev2.dist-info}/WHEEL +0 -0
  62. {quarchpy-2.1.24.dev1.dist-info → quarchpy-2.1.24.dev2.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,17 @@
1
- from quarchpy import *
2
- from quarchpy.device import *
3
- from importlib.metadata import distribution
1
+ # from quarchpy import *
2
+ # from quarchpy.device import *
3
+ try:
4
+ from importlib.metadata import distribution
5
+ except:
6
+ try:
7
+ from importlib_metadata import distribution
8
+ except Exception as e:
9
+ print("Failed to import distribution from importlib_metadata")
10
+ try:
11
+
12
+ from importlib_metadata import distribution
13
+ except:
14
+ print("here")
4
15
  import os
5
16
  import platform
6
17
  import sys
@@ -19,7 +19,7 @@ from quarchpy.device import quarchDevice, quarchArray
19
19
  from quarchpy.connection_specific.connection_Serial import serialList, serial
20
20
  from quarchpy.device.quarchArray import isThisAnArrayController
21
21
  from quarchpy.connection_specific.connection_USB import TQuarchUSB_IF
22
- from quarchpy.connection_specific import connection_ReST
22
+ from quarchpy.connection_specific import connection_ReST, connection_TCP
23
23
  from quarchpy.connection_specific.connection_mDNS import MyListener
24
24
  from quarchpy.utilities import TestCenter
25
25
 
@@ -306,8 +306,13 @@ def get_user_level_serial_number(network_modules):
306
306
  ''''''
307
307
  def lookupDevice(ipAddressLookup, mySocket, lan_modules):
308
308
  try:
309
- logging.debug("Ipaddress lookup " + ipAddressLookup)
309
+ specifiedDevice =None
310
310
  # For future reference, 0 is the C terminator for a string
311
+ timeout = mySocket.gettimeout()
312
+ # mySocket.settimeout(20)
313
+ # timeout2 = mySocket.gettimeout()
314
+ logging.debug("Ipaddress lookup =" + ipAddressLookup+ " timeout = "+ str(timeout))
315
+
311
316
  mySocket.sendto(b'Discovery: Who is out there?\0\n', (str(ipAddressLookup).strip(), 30303))
312
317
  specifiedDevice = mySocket.recvfrom(256)
313
318
  # Check to see if the response contains the connection protocol
@@ -315,26 +320,47 @@ def lookupDevice(ipAddressLookup, mySocket, lan_modules):
315
320
  except Exception as e:
316
321
  logging.warning("Error during UDP lookup of IP address "+ str(ipAddressLookup) +" Error: " + str(e))
317
322
  logging.warning("No Quarch module found at this address. Please check the IP address and that you can ping it.\r\n")
318
- return None
319
- #
320
- # if specifiedDevice is None: #Only True if TCP not found or errored
321
- # try:
322
- # restCon = connection_ReST.ReSTConn(str(ipAddressLookup).replace("\r\n", ""))
323
- # restDevice = restCon.sendCommand("*enclosure?") #Try use enclosure for PPMs
324
- # if "fail" in restDevice.lower(): # This will fail nicely for other modules
325
- # restDevice = restCon.sendCommand("*serial?") # and serial number will be used in place.
326
- # if not str(restDevice).startswith("QTL"):
327
- # restDevice = "QTL" + restDevice
328
- # # Exit as device was found correctly
329
- # # Add the item to list
330
- # lan_modules["REST:" + str(ipAddressLookup).replace("\r\n", "")] = restDevice
331
- # specifiedDevice=None # Don't return rest connection, to bypass tcp parsing.
332
- # except Exception as e:
333
- # logging.warning("Error During REST scan of IP address " + str(ipAddressLookup) + " Error: " + str(e))
334
- # logging.warning("Please check the IP address and that you can ping it.\r\n")
335
- #
336
- # # Needs to return None so previous method will not attempt another lookup.
337
- # return specifiedDevice
323
+
324
+ #return None # Commented out, attempt a REST connection with IP. This is what other quarch applications do.
325
+ if specifiedDevice is None: #Only True if TCP not found or errored
326
+ try:
327
+ restCon = connection_ReST.ReSTConn(str(ipAddressLookup).replace("\r\n", ""))
328
+ restDevice = restCon.sendCommand("*enclosure?") #Try use enclosure for PPMs
329
+ if "fail" in restDevice.lower(): # This will fail nicely for other modules
330
+ restDevice = restCon.sendCommand("*serial?") # and serial number will be used in place.
331
+ if not str(restDevice).startswith("QTL"):
332
+ restDevice = "QTL" + restDevice
333
+ # Exit as device was found correctly
334
+ # Add the item to list
335
+ lan_modules["REST:" + str(ipAddressLookup).replace("\r\n", "")] = restDevice
336
+ specifiedDevice=None # Don't return rest connection, to bypass tcp parsing.
337
+ except Exception as e:
338
+ logging.warning("Error During REST scan of IP address " + str(ipAddressLookup) + " Error: " + str(e))
339
+ logging.warning("Please check the IP address and that you can ping it.\r\n")
340
+ try:
341
+ # from threading import Thread
342
+ # t = Thread(target=connection_TCP.TCPConn, args=(str(ipAddressLookup).replace("\r\n", ""),))
343
+ # t.daemon = True
344
+ # t.start()
345
+ # t.join(50)
346
+ # if t.is_alive():
347
+ # raise TimeoutError("Timeout during TCP Connection attempt.")
348
+
349
+ tcpCon= connection_TCP.TCPConn(str(ipAddressLookup).replace("\r\n", ""))
350
+ tcpDevice = tcpCon.sendCommand("*enclosure?") #Try use enclosure for PPMs
351
+ if "fail" in tcpDevice.lower(): # This will fail nicely for other modules
352
+ tcpDevice = tcpCon.sendCommand("*serial?") # and serial number will be used in place.
353
+ if not str(tcpDevice).startswith("QTL"):
354
+ tcpDevice = "QTL" + tcpDevice
355
+ # Exit as device was found correctly
356
+ # Add the item to list
357
+ lan_modules["TCP:" + str(ipAddressLookup).replace("\r\n", "")] = tcpDevice
358
+ specifiedDevice=None # Don't return tcp connection, to bypass tcp parsing.
359
+ except Exception as e:
360
+ logging.warning("Error During TCP scan of IP address " + str(ipAddressLookup) + " Error: " + str(e))
361
+ logging.warning("Please check the IP address and that you can ping it.\r\n")
362
+ # Needs to return None so previous method will not attempt another lookup.
363
+ return specifiedDevice
338
364
 
339
365
 
340
366
 
Binary file