itkdb-gtk 0.18.0.dev3__py3-none-any.whl → 0.19.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.

Potentially problematic release.


This version of itkdb-gtk might be problematic. Click here for more details.

itkdb_gtk/QRScanner.py CHANGED
@@ -2,43 +2,12 @@
2
2
  """A set of utilities for teh warp scanner."""
3
3
  import pathlib
4
4
  import serial
5
+ import serial.tools.list_ports as list_ports
5
6
 
6
7
  import gi
7
8
  gi.require_version("Gtk", "3.0")
8
9
  from gi.repository import GLib
9
10
 
10
- def setup_scanner(callback):
11
- """Setup scanner and callback function."""
12
- rdr = None
13
- for fnam in ["/dev/ttyACM0", "/dev/cu.usbmodemS_N_G19F204881"]:
14
- P = pathlib.Path(fnam)
15
- if P.exists():
16
- rdr = serial.Serial(fnam, 9600)
17
- GLib.unix_fd_add_full(
18
- GLib.PRIORITY_DEFAULT,
19
- rdr.fileno(),
20
- GLib.IOCondition.IN | GLib.IOCondition.ERR | GLib.IOCondition.HUP | GLib.IOCondition.NVAL,
21
- callback,
22
- rdr,
23
- )
24
- break
25
-
26
- return rdr
27
-
28
- def scanner_get_line(reader):
29
- """Reads a line from serial."""
30
- available = reader.in_waiting
31
- while True:
32
- delta = reader.in_waiting - available
33
- if not delta:
34
- break
35
-
36
- # Get data from serial device passed in via
37
- data = reader.read_until(expected='\r', size=reader.in_waiting).strip()
38
- txt = data.decode('utf-8')
39
- return txt
40
-
41
-
42
11
  class QRScanner:
43
12
  """Contains information to detect the scanner."""
44
13
  def __init__(self, callback):
@@ -78,19 +47,19 @@ class QRScanner:
78
47
  return
79
48
 
80
49
  self.reader = None
81
- for fnam in ["/dev/ttyACM0", "/dev/cu.usbmodemS_N_G19F204881"]:
82
- P = pathlib.Path(fnam)
83
- if P.exists():
84
- self.reader = serial.Serial(fnam, 9600)
85
- self.source_id = GLib.unix_fd_add_full(
86
- GLib.PRIORITY_DEFAULT,
87
- self.reader.fileno(),
88
- #GLib.IOCondition.IN | GLib.IOCondition.ERR | GLib.IOCondition.HUP | GLib.IOCondition.NVAL,
89
- GLib.IOCondition.IN | GLib.IOCondition.ERR | GLib.IOCondition.NVAL,
90
- self.get_line,
91
- self.callback,
50
+ device_signature = '05f9:4204'
51
+ candidates = list(list_ports.grep(device_signature))
52
+ if not candidates:
53
+ return
54
+
55
+ self.reader = serial.Serial(candidates[0].device, 9600)
56
+ self.source_id = GLib.unix_fd_add_full(
57
+ GLib.PRIORITY_DEFAULT,
58
+ self.reader.fileno(),
59
+ GLib.IOCondition.IN | GLib.IOCondition.ERR | GLib.IOCondition.NVAL,
60
+ self.get_line,
61
+ self.callback,
92
62
  )
93
- break
94
63
 
95
64
 
96
65
  def finish_timeout(self):
@@ -147,4 +116,4 @@ def test_scanner():
147
116
  loop.quit()
148
117
 
149
118
  if __name__ == "__main__":
150
- test_scanner()
119
+ test_scanner()
itkdb_gtk/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """ itkdb-gtk python module
2
2
  """
3
- __version__ = "0.18.0.dev3"
3
+ __version__ = "0.19.0"
4
4
 
5
5
 
6
6
  def dash_board():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itkdb_gtk
3
- Version: 0.18.0.dev3
3
+ Version: 0.19.0
4
4
  Summary: A collection of Gtk based GUI to access ITkDB.
5
5
  Author-email: Carlos Lacasta <carlos.lacasta@cern.ch>
6
6
  Project-URL: Homepage, https://gitlab.cern.ch/atlas-itk/sw/db/itk-pdb-gtk-gui-utils
@@ -6,7 +6,7 @@ itkdb_gtk/ITkDB.svg,sha256=Ry702zrUkxvG61SqThbUNfXySyiLMqalwYpcM-b_KWo,24242
6
6
  itkdb_gtk/ITkDBlogin.py,sha256=40tipm_j5eUS4dnZnBT8VyL6Bu_8csuqS9TPWKxvKSY,10038
7
7
  itkdb_gtk/ITkDButils.py,sha256=mcvxxvg1Sqhw4cGe6BUi2Zq4tDNWFWD49izFPI8qhzo,21632
8
8
  itkdb_gtk/PanelVisualInspection.py,sha256=0Uy30SNA4I-F1PJfK3tqNb6VQZLGH84VBEwlT3HdF5E,20466
9
- itkdb_gtk/QRScanner.py,sha256=s37NBL1bL7y51-9ZvXij8XDp7-EQ3t3xAYnx7eEsQ3k,4499
9
+ itkdb_gtk/QRScanner.py,sha256=e7c8LDjd5j5PIXlYMjtALNs-xFrRaxvVIVny0cTV0Uo,3465
10
10
  itkdb_gtk/SensorUtils.py,sha256=fYWF9TeutAbore53dLWNlZnVn9P3OsKYcFLNGOs8cnI,15426
11
11
  itkdb_gtk/ShowAttachments.py,sha256=KExxPCdbcb04XS8JSUkg5xF1McvlB8e9btwctDCKNXU,8498
12
12
  itkdb_gtk/ShowComments.py,sha256=OiMTFLnhGbbKRj5x61D517BYHAt-qY5Y1lvR3EQz3c0,3151
@@ -16,14 +16,14 @@ itkdb_gtk/UploadMultipleTests.py,sha256=tFXGyeIC-c1Gh_Fyjr_AddDnKReGMrMphdotRzIs
16
16
  itkdb_gtk/UploadTest.py,sha256=ukgJ5-IG12bqa1QIp3bXIV8hkdXCv5UDxh1lQswN_ko,16832
17
17
  itkdb_gtk/VisualInspection.py,sha256=sTEhWrWW9Cez2ABLq1nggnvnncT2nZEsb3KWCSN6GCM,9798
18
18
  itkdb_gtk/WireBondGui.py,sha256=WFTLOw4l5JxSbvh4vZMxcF65fqlwvNw0fOyEru9ijqQ,39850
19
- itkdb_gtk/__init__.py,sha256=3hxtTYPuQ7PS9M06-6dwu0zC4pFDtYf8KQeCjTE-6uo,1274
19
+ itkdb_gtk/__init__.py,sha256=O4gjWnv-_SS8ZX7NerL2spc2EZpHg7HA-TZDEUYC4DI,1269
20
20
  itkdb_gtk/dashBoard.py,sha256=1kNSJn-iJ-ME6Nhtz-TfjFQsdKIlBooExrD8U_LgyEA,12293
21
21
  itkdb_gtk/dbGtkUtils.py,sha256=UEdqVdw8OxAmDzVeCKncUq7mUJkCclV7tEZu0dadics,29629
22
22
  itkdb_gtk/findComponent.py,sha256=zXksALmvsKRDasYMfRETY_dYZ2P73GRLTmioVRHZD9w,4113
23
23
  itkdb_gtk/readGoogleSheet.py,sha256=Lzm_oPWwDqZZzKoBUgsp277F9-wCfr_BA0X4VD2Eolo,2673
24
24
  itkdb_gtk/untrash_component.py,sha256=VrN46-f-kF7voOxtoh7OL-bZSWAaIFb7-Xbx6_WT7K8,757
25
- itkdb_gtk-0.18.0.dev3.dist-info/METADATA,sha256=djaTqNjH90ETBGAxJiD_YfT24rVFWO8aS_y-NX452r4,3154
26
- itkdb_gtk-0.18.0.dev3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- itkdb_gtk-0.18.0.dev3.dist-info/entry_points.txt,sha256=vN0_mqIT6NwsnHirFsf3JHu-wq8CSHXE1IlhZzB5sbU,481
28
- itkdb_gtk-0.18.0.dev3.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
29
- itkdb_gtk-0.18.0.dev3.dist-info/RECORD,,
25
+ itkdb_gtk-0.19.0.dist-info/METADATA,sha256=dQ6rHu36wMlGSb8tW3-nCfS7HJsphV6J8mTwwuD4dW0,3149
26
+ itkdb_gtk-0.19.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ itkdb_gtk-0.19.0.dist-info/entry_points.txt,sha256=vN0_mqIT6NwsnHirFsf3JHu-wq8CSHXE1IlhZzB5sbU,481
28
+ itkdb_gtk-0.19.0.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
29
+ itkdb_gtk-0.19.0.dist-info/RECORD,,