itkdb-gtk 0.18.0.dev3__py3-none-any.whl → 0.19.1__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 +15 -45
- itkdb_gtk/__init__.py +1 -1
- {itkdb_gtk-0.18.0.dev3.dist-info → itkdb_gtk-0.19.1.dist-info}/METADATA +1 -1
- {itkdb_gtk-0.18.0.dev3.dist-info → itkdb_gtk-0.19.1.dist-info}/RECORD +7 -7
- {itkdb_gtk-0.18.0.dev3.dist-info → itkdb_gtk-0.19.1.dist-info}/WHEEL +0 -0
- {itkdb_gtk-0.18.0.dev3.dist-info → itkdb_gtk-0.19.1.dist-info}/entry_points.txt +0 -0
- {itkdb_gtk-0.18.0.dev3.dist-info → itkdb_gtk-0.19.1.dist-info}/top_level.txt +0 -0
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
50
|
+
device_signature = '05f9:4204|1a86:7523'
|
|
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):
|
|
@@ -140,6 +109,7 @@ def get_text_from_scanner(txt):
|
|
|
140
109
|
def test_scanner():
|
|
141
110
|
"""Test the thing."""
|
|
142
111
|
scanner = QRScanner(get_text_from_scanner)
|
|
112
|
+
|
|
143
113
|
loop = GLib.MainLoop()
|
|
144
114
|
try:
|
|
145
115
|
loop.run()
|
|
@@ -147,4 +117,4 @@ def test_scanner():
|
|
|
147
117
|
loop.quit()
|
|
148
118
|
|
|
149
119
|
if __name__ == "__main__":
|
|
150
|
-
test_scanner()
|
|
120
|
+
test_scanner()
|
itkdb_gtk/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: itkdb_gtk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.19.1
|
|
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=
|
|
9
|
+
itkdb_gtk/QRScanner.py,sha256=igSxIyaPSbWxChhd6du4MKuQ0m6Sd3irrAt374KZlB0,3480
|
|
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=
|
|
19
|
+
itkdb_gtk/__init__.py,sha256=hD3XECiCxyrCgHEJWVJqLHjwgXae3MyRRsZLbUfWwco,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.
|
|
26
|
-
itkdb_gtk-0.
|
|
27
|
-
itkdb_gtk-0.
|
|
28
|
-
itkdb_gtk-0.
|
|
29
|
-
itkdb_gtk-0.
|
|
25
|
+
itkdb_gtk-0.19.1.dist-info/METADATA,sha256=Y3R3kRM0UR1YvyruQk1CyF3Li2Y-kNg53tohVK7LMb0,3149
|
|
26
|
+
itkdb_gtk-0.19.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
itkdb_gtk-0.19.1.dist-info/entry_points.txt,sha256=vN0_mqIT6NwsnHirFsf3JHu-wq8CSHXE1IlhZzB5sbU,481
|
|
28
|
+
itkdb_gtk-0.19.1.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
|
|
29
|
+
itkdb_gtk-0.19.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|