itkdb-gtk 0.17.0__tar.gz → 0.18.0.dev1__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.

Potentially problematic release.


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

Files changed (40) hide show
  1. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/PKG-INFO +1 -1
  2. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/__init__.py +1 -1
  3. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/dashBoard.py +30 -0
  4. itkdb_gtk-0.18.0.dev1/itkdb_gtk/findComponent.py +141 -0
  5. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk.egg-info/PKG-INFO +1 -1
  6. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk.egg-info/SOURCES.txt +1 -0
  7. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/pyproject.toml +1 -1
  8. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/README.md +0 -0
  9. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/CreateShipments.py +0 -0
  10. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/GetShipments.py +0 -0
  11. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/GlueWeight.py +0 -0
  12. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/ITkDB.desktop +0 -0
  13. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/ITkDB.svg +0 -0
  14. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/ITkDBlogin.py +0 -0
  15. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/ITkDButils.py +0 -0
  16. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/PanelVisualInspection.py +0 -0
  17. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/SensorUtils.py +0 -0
  18. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/ShowAttachments.py +0 -0
  19. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/ShowComments.py +0 -0
  20. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/ShowDefects.py +0 -0
  21. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/UploadModuleIV.py +0 -0
  22. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/UploadMultipleTests.py +0 -0
  23. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/UploadTest.py +0 -0
  24. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/VisualInspection.py +0 -0
  25. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/WireBondGui.py +0 -0
  26. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/dbGtkUtils.py +0 -0
  27. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/readGoogleSheet.py +0 -0
  28. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk/untrash_component.py +0 -0
  29. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk.egg-info/dependency_links.txt +0 -0
  30. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk.egg-info/entry_points.txt +0 -0
  31. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk.egg-info/requires.txt +0 -0
  32. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/itkdb_gtk.egg-info/top_level.txt +0 -0
  33. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/setup.cfg +0 -0
  34. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/test/testAnimated.py +0 -0
  35. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/test/testBatch.py +0 -0
  36. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/test/testComponent.py +0 -0
  37. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/test/testRange.py +0 -0
  38. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/test/testThread.py +0 -0
  39. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/test/test_attachment.py +0 -0
  40. {itkdb_gtk-0.17.0 → itkdb_gtk-0.18.0.dev1}/test/test_holes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itkdb_gtk
3
- Version: 0.17.0
3
+ Version: 0.18.0.dev1
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
@@ -1,6 +1,6 @@
1
1
  """ itkdb-gtk python module
2
2
  """
3
- __version__ = "0.17.0"
3
+ __version__ = "0.18.0.dev1"
4
4
 
5
5
 
6
6
  def dash_board():
@@ -22,6 +22,7 @@ from itkdb_gtk import UploadModuleIV
22
22
  from itkdb_gtk import WireBondGui
23
23
  from itkdb_gtk import PanelVisualInspection
24
24
  from itkdb_gtk import VisualInspection
25
+ from itkdb_gtk import findComponent
25
26
 
26
27
 
27
28
  HAS_PETALQC=False
@@ -59,6 +60,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
59
60
  PETAL_CORE_METRO = 11
60
61
  PETAL_CORE_THERMAL = 12
61
62
  PETAL_INFORMATION = 13
63
+ FIND_COMPONENT = 14
62
64
 
63
65
  def __init__(self, session):
64
66
  """Initialization."""
@@ -162,6 +164,19 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
162
164
  recS.connect("clicked", self.receive_shipment)
163
165
  grid.attach(recS, 1, irow, 1, 1,)
164
166
 
167
+ irow += 1
168
+ lbl = Gtk.Label()
169
+ lbl.set_markup("<b>Utils</b>")
170
+ lbl.set_xalign(0)
171
+ grid.attach(lbl, 0, irow, 1, 1)
172
+
173
+ irow += 1
174
+ findC = Gtk.Button(label="Find Component")
175
+ findC.connect("clicked", self.find_component)
176
+ findC.set_tooltip_text("Scan your QR or bar code and get info from DB.")
177
+ grid.attach(findC, 0, irow, 1, 1,)
178
+
179
+
165
180
  self.mainBox.pack_start(Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL), False, True, 5)
166
181
 
167
182
  self.show_all()
@@ -296,6 +311,21 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
296
311
  W.connect("destroy", self.app_closed, bitn)
297
312
  W.show_all()
298
313
 
314
+
315
+ def find_component(self, *args):
316
+ """Find Component."""
317
+ bitn = DashWindow.FIND_COMPONENT
318
+ bt = 1 << bitn
319
+ if self.mask & bt:
320
+ return
321
+
322
+ W = findComponent.FindComponent(
323
+ self.session,
324
+ help_link="{}/findComponent.html".format(HELP_LINK)
325
+ )
326
+
327
+ W.connect("destroy", self.app_closed, bitn)
328
+
299
329
  def petal_reception(self, *args):
300
330
  """Petal GND/VI test."""
301
331
  bitn = DashWindow.PETAL_RECEPTION
@@ -0,0 +1,141 @@
1
+ #!/usr/bin/env python3
2
+ """GUI to upload tests."""
3
+ import argparse
4
+ import json
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ try:
9
+ import itkdb_gtk
10
+
11
+ except ImportError:
12
+ cwd = Path(__file__).parent.parent
13
+ sys.path.append(cwd.as_posix())
14
+
15
+ from itkdb_gtk import dbGtkUtils, ITkDBlogin, ITkDButils
16
+ from itkdb_gtk.GetShipments import find_vtrx
17
+
18
+
19
+ import gi
20
+ gi.require_version("Gtk", "3.0")
21
+ from gi.repository import Gtk, Gio
22
+
23
+ class FindComponent(dbGtkUtils.ITkDBWindow):
24
+ """Read QR of bar code and retrieve information about component."""
25
+
26
+ def __init__(self, session, help_link=None):
27
+ """Initialization.
28
+
29
+ Args:
30
+ session: ITkDB session
31
+ help_link: link to help page.
32
+
33
+ """
34
+ super().__init__(session=session, title="Find Component", help_link=help_link)
35
+ self.init_window()
36
+
37
+ def init_window(self):
38
+ """Create the Gtk window."""
39
+ # Initial tweaks
40
+ self.set_border_width(10)
41
+
42
+ # Prepare HeaderBar
43
+ self.hb.props.title = "Find Component"
44
+
45
+ # Object Data
46
+ lbl = Gtk.Label(label="Scan your QR or bar code. Information will appear below.")
47
+ self.mainBox.pack_start(lbl, True, True, 0)
48
+
49
+ #btn = Gtk.Button(label="Test Button")
50
+ #btn.connect("clicked", self.test_qrcode)
51
+ #self.mainBox.pack_start(btn, True, True, 0)
52
+
53
+ # The text view
54
+ self.mainBox.pack_start(self.message_panel.frame, True, True, 0)
55
+
56
+ self.show_all()
57
+
58
+ def get_qrcode(self, fd, state, reader):
59
+ """Gets data from QR scanner."""
60
+ txt = dbGtkUtils.scanner_get_line(reader)
61
+ self.write_message("{}\n".format(txt))
62
+
63
+ if txt.find("J-SD") == 0:
64
+ try:
65
+ SN = find_vtrx(self.session, txt)
66
+ except ValueError as e:
67
+ self.write_message("Error: {}\n".format(e))
68
+ return
69
+ else:
70
+ SN = txt
71
+
72
+ obj = ITkDButils.get_DB_component(self.session, SN)
73
+ if obj is None:
74
+ self.write_message("Object not found in DB\n")
75
+ return
76
+
77
+ msg = "\nObject SN: {}\nObject Alt. ID: {}\nObject Type: {}\nObject Loc. {}\nObject stage: {} - {}".format(
78
+ obj["serialNumber"],
79
+ obj["alternativeIdentifier"],
80
+ obj["componentType"]["name"],
81
+ obj["currentLocation"]["name"],
82
+ obj["currentStage"]["code"],
83
+ obj["currentStage"]["name"])
84
+
85
+ self.write_message(msg)
86
+
87
+ def test_qrcode(self, *args):
88
+ """Gets data from QR scanner."""
89
+ txt = "a3c671bf38d3957dc053c6e5471aa27e"
90
+ self.write_message("{}\n".format(txt))
91
+
92
+ if txt.find("J-SD") == 0:
93
+ try:
94
+ SN = find_vtrx(self.session, txt)
95
+ except ValueError as e:
96
+ self.write_message("Error: {}\n".format(e))
97
+ return
98
+ else:
99
+ SN = txt
100
+
101
+ obj = ITkDButils.get_DB_component(self.session, SN)
102
+ if obj is None:
103
+ self.write_message("Object not found in DB\n")
104
+ return
105
+
106
+
107
+ msg = "\n\nObject SN: {}\nObject Alt. ID: {}\nObject Type: {}\nObject Loc.: {}\nObject stage: {} - {}\n".format(
108
+ obj["serialNumber"],
109
+ obj["alternativeIdentifier"],
110
+ obj["componentType"]["name"],
111
+ obj["currentLocation"]["name"],
112
+ obj["currentStage"]["code"],
113
+ obj["currentStage"]["name"])
114
+
115
+ self.write_message(msg)
116
+
117
+ def main():
118
+ """Main entry."""
119
+ HELP_LINK="https://itkdb-gtk.docs.cern.ch/uploadSingleTest.html"
120
+
121
+ # DB login
122
+ dlg = ITkDBlogin.ITkDBlogin()
123
+ client = dlg.get_client()
124
+ if client is None:
125
+ print("Could not connect to DB with provided credentials.")
126
+ dlg.die()
127
+ sys.exit()
128
+
129
+ client.user_gui = dlg
130
+
131
+ window = FindComponent(client, help_link=HELP_LINK)
132
+ try:
133
+ Gtk.main()
134
+
135
+ except KeyboardInterrupt:
136
+ print("Arrrgggg!!!")
137
+
138
+ dlg.die()
139
+
140
+ if __name__ == "__main__":
141
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itkdb_gtk
3
- Version: 0.17.0
3
+ Version: 0.18.0.dev1
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
@@ -20,6 +20,7 @@ itkdb_gtk/WireBondGui.py
20
20
  itkdb_gtk/__init__.py
21
21
  itkdb_gtk/dashBoard.py
22
22
  itkdb_gtk/dbGtkUtils.py
23
+ itkdb_gtk/findComponent.py
23
24
  itkdb_gtk/readGoogleSheet.py
24
25
  itkdb_gtk/untrash_component.py
25
26
  itkdb_gtk.egg-info/PKG-INFO
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "itkdb_gtk"
7
- version = "0.17.0"
7
+ version = "0.18.0.dev1"
8
8
  authors = [
9
9
  { name="Carlos Lacasta", email="carlos.lacasta@cern.ch" },
10
10
  ]
File without changes
File without changes