syndesi 0.2.1__tar.gz → 0.2.2__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 (39) hide show
  1. {syndesi-0.2.1/syndesi.egg-info → syndesi-0.2.2}/PKG-INFO +1 -1
  2. {syndesi-0.2.1 → syndesi-0.2.2}/setup.py +1 -1
  3. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/serialport.py +10 -29
  4. {syndesi-0.2.1 → syndesi-0.2.2/syndesi.egg-info}/PKG-INFO +1 -1
  5. {syndesi-0.2.1 → syndesi-0.2.2}/LICENSE +0 -0
  6. {syndesi-0.2.1 → syndesi-0.2.2}/README.md +0 -0
  7. {syndesi-0.2.1 → syndesi-0.2.2}/setup.cfg +0 -0
  8. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/__init__.py +0 -0
  9. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/__init__.py +0 -0
  10. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/adapter.py +0 -0
  11. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/auto.py +0 -0
  12. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/ip.py +0 -0
  13. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/ip_server.py +0 -0
  14. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/proxy.py +0 -0
  15. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/stop_conditions.py +0 -0
  16. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/timed_queue.py +0 -0
  17. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/timeout.py +0 -0
  18. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/adapters/visa.py +0 -0
  19. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/api/__init__.py +0 -0
  20. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/api/api.py +0 -0
  21. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/protocols/__init__.py +0 -0
  22. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/protocols/delimited.py +0 -0
  23. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/protocols/protocol.py +0 -0
  24. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/protocols/raw.py +0 -0
  25. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/protocols/scpi.py +0 -0
  26. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/protocols/sdp.py +0 -0
  27. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/proxy/__init__.py +0 -0
  28. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/proxy/proxy.py +0 -0
  29. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/proxy/proxy_api.py +0 -0
  30. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/tools/__init__.py +0 -0
  31. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/tools/exceptions.py +0 -0
  32. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/tools/log.py +0 -0
  33. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/tools/others.py +0 -0
  34. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/tools/shell.py +0 -0
  35. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi/tools/types.py +0 -0
  36. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi.egg-info/SOURCES.txt +0 -0
  37. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi.egg-info/dependency_links.txt +0 -0
  38. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi.egg-info/entry_points.txt +0 -0
  39. {syndesi-0.2.1 → syndesi-0.2.2}/syndesi.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: syndesi
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Syndesi
5
5
  Author: Sebastien Deriaz
6
6
  Author-email: sebastien.deriaz1@gmail.com
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  DESCRIPTION = 'Syndesi'
5
5
 
6
6
  with open("README.md", "r", encoding="utf-8") as fh:
@@ -14,16 +14,6 @@ from .timed_queue import TimedQueue
14
14
  from ..tools import shell
15
15
  from ..tools.others import DEFAULT
16
16
 
17
- # From pyserial - serialposix.py
18
- import fcntl
19
- import termios
20
- import struct
21
- if hasattr(termios, 'TIOCINQ'):
22
- TIOCINQ = termios.TIOCINQ
23
- else:
24
- TIOCINQ = getattr(termios, 'FIONREAD', 0x541B)
25
- TIOCM_zero_str = struct.pack('I', 0)
26
-
27
17
  DEFAULT_TIMEOUT = Timeout(response=1, continuation=200e-3, total=None)
28
18
 
29
19
  class SerialPort(Adapter):
@@ -53,8 +43,6 @@ class SerialPort(Adapter):
53
43
  self._status = self.Status.DISCONNECTED
54
44
 
55
45
  self._rts_cts = rts_cts
56
-
57
- self._stop_event_pipe, self._stop_event_pipe_write = os.pipe()
58
46
 
59
47
  def flushRead(self):
60
48
  self._port.flush()
@@ -68,10 +56,8 @@ class SerialPort(Adapter):
68
56
  self._logger.info("Adapter opened !")
69
57
 
70
58
  def close(self):
71
- if self._thread is not None and self._thread.is_alive():
72
- os.write(self._stop_event_pipe_write, b'1')
73
- self._thread.join()
74
59
  if hasattr(self, '_port'):
60
+ # Close and the read thread will die by itself
75
61
  self._port.close()
76
62
  self._logger.info("Adapter closed !")
77
63
 
@@ -92,24 +78,19 @@ class SerialPort(Adapter):
92
78
  """
93
79
  self._logger.debug("Starting read thread...")
94
80
  if self._thread is None or not self._thread.is_alive():
95
- self._thread = Thread(target=self._read_thread, daemon=True, args=(self._port, self._read_queue, self._stop_event_pipe))
81
+ self._thread = Thread(target=self._read_thread, daemon=True, args=(self._port, self._read_queue))
96
82
  self._thread.start()
97
83
 
98
- def _read_thread(self, port : serial.Serial , read_queue : TimedQueue, stop_event_pipe):
84
+ def _read_thread(self, port : serial.Serial , read_queue : TimedQueue):
85
+ # NOTE : There should be some way to kill the thread, maybe check for an error on in_waiting but couldn't find it so far
99
86
  while True:
100
- # It looks like using the raw implementation of port.in_waiting and port.read is better, there's no more warnings
101
- # Equivalent of port.in_waiting :
102
- #in_waiting = struct.unpack('I', fcntl.ioctl(port.fd, TIOCINQ, TIOCM_zero_str))[0]
87
+ # Check how many bytes are available
103
88
  in_waiting = self._port.in_waiting # This is a temporary fix to get windows compatiblity back, an error might pop up
104
- if in_waiting == 0:
105
- ready, _, _ = select.select([port.fd, stop_event_pipe], [], [], None)
106
- if stop_event_pipe in ready:
107
- # Stop
108
- break
109
- # Else, read as many bytes as possible
110
- fragment = os.read(port.fd, 1000) # simplified version of port.read()
111
- if fragment:
112
- read_queue.put(fragment)
89
+ if in_waiting > 0:
90
+ # Read those bytes
91
+ fragment = port.read(in_waiting)
92
+ if fragment:
93
+ read_queue.put(fragment)
113
94
 
114
95
  def read(self, timeout=None, stop_condition=None, return_metrics: bool = False) -> bytes:
115
96
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: syndesi
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Syndesi
5
5
  Author: Sebastien Deriaz
6
6
  Author-email: sebastien.deriaz1@gmail.com
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes