itkdb-gtk 0.9.0__py3-none-any.whl → 0.9.1.dev1__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.

@@ -103,14 +103,14 @@ def check_data(data):
103
103
  class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
104
104
  """Collects information to upload a test and its attachments."""
105
105
 
106
- def __init__(self, session):
106
+ def __init__(self, session, help=help):
107
107
  """Initialization.
108
108
 
109
109
  Args:
110
110
  session: ITkDB session
111
111
 
112
112
  """
113
- super().__init__(session=session, title="Upload Tests", gtk_runs=gtk_runs)
113
+ super().__init__(session=session, title="Upload Tests", gtk_runs=gtk_runs, help=help)
114
114
  self.tests = []
115
115
 
116
116
  self.init_window()
itkdb_gtk/UploadTest.py CHANGED
@@ -78,7 +78,7 @@ def check_data(data):
78
78
  class UploadTest(dbGtkUtils.ITkDBWindow):
79
79
  """Collects information to upload a test and its attachments."""
80
80
 
81
- def __init__(self, session, payload=None, attachment=None):
81
+ def __init__(self, session, payload=None, attachment=None, help=None):
82
82
  """Initialization.
83
83
 
84
84
  Args:
@@ -107,7 +107,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
107
107
 
108
108
  global gtk_runs
109
109
  if gtk_runs:
110
- super().__init__(session=session, title="Upload Test", gtk_runs=gtk_runs)
110
+ super().__init__(session=session, title="Upload Test", gtk_runs=gtk_runs, help=help)
111
111
  self.init_window()
112
112
 
113
113
  def init_window(self):
@@ -353,7 +353,9 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
353
353
 
354
354
  def find_attachments(self):
355
355
  """Find Attachments in payload."""
356
- self.attachments = []
356
+ # We used to clean the attachmetns, but this would remove the ones given
357
+ # in the contructor.
358
+ # self.attachments = []
357
359
  if "attachments" in self.data:
358
360
  for A in self.data["attachments"]:
359
361
  if not Path(A["path"]).exists():
itkdb_gtk/__init__.py CHANGED
@@ -1,4 +1,6 @@
1
- __version__ = "0.9.0"
1
+ """ itkdb-gtk python module
2
+ """
3
+ __version__ = "0.9.1.dev1"
2
4
 
3
5
 
4
6
  def dash_board():
@@ -19,9 +21,9 @@ def glueWeight():
19
21
  main()
20
22
 
21
23
 
22
- def groundVITests():
24
+ def petalReceptionTests():
23
25
  """GND/VI tests."""
24
- from .GroundVITests import main
26
+ from .PetalReceptionTests import main
25
27
  main()
26
28
 
27
29
 
itkdb_gtk/dashBoard.py CHANGED
@@ -13,7 +13,7 @@ except ImportError:
13
13
 
14
14
  from itkdb_gtk import dbGtkUtils
15
15
  from itkdb_gtk import GetShipments
16
- from itkdb_gtk import GroundVITests
16
+ from itkdb_gtk import PetalReceptionTests
17
17
  from itkdb_gtk import ITkDBlogin
18
18
  from itkdb_gtk import CreateShipments
19
19
  from itkdb_gtk import UploadTest
@@ -27,6 +27,7 @@ import gi
27
27
  gi.require_version("Gtk", "3.0")
28
28
  from gi.repository import Gtk
29
29
 
30
+ HELP_LINK="https://itkdb-gtk.docs.cern.ch"
30
31
 
31
32
  class DashWindow(dbGtkUtils.ITkDBWindow):
32
33
  """Dashboard class."""
@@ -41,7 +42,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
41
42
 
42
43
  def __init__(self, session):
43
44
  """Initialization."""
44
- super().__init__(title="ITkDB Dashboard", session=session)
45
+ super().__init__(title="ITkDB Dashboard", session=session, help=HELP_LINK)
45
46
  self.mask = 0
46
47
 
47
48
  # set border width
@@ -71,7 +72,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
71
72
  grid.attach(btnTest, 1, irow, 1, 1)
72
73
 
73
74
  irow += 1
74
- btnGnd = Gtk.Button(label="Petal VI/GND")
75
+ btnGnd = Gtk.Button(label="Petal Reception")
75
76
  btnGnd.connect("clicked", self.petal_gnd)
76
77
  grid.attach(btnGnd, 0, irow, 1, 1)
77
78
 
@@ -80,7 +81,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
80
81
  grid.attach(btnWeight, 1, irow, 1, 1)
81
82
 
82
83
  irow += 1
83
- btnModIV = Gtk.Button(label="Module IV")
84
+ btnModIV = Gtk.Button(label="Sensor/Module IV")
84
85
  btnModIV.connect("clicked", self.module_IV)
85
86
  grid.attach(btnModIV, 0, irow, 1, 1)
86
87
 
@@ -120,7 +121,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
120
121
  return
121
122
 
122
123
  self.mask |= bt
123
- W = UploadTest.UploadTest(self.session)
124
+ W = UploadTest.UploadTest(self.session, help=HELP_LINK)
124
125
  W.connect("destroy", self.app_closed, bitn)
125
126
 
126
127
  def upload_multiple_tests(self, *args):
@@ -131,7 +132,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
131
132
  return
132
133
 
133
134
  self.mask |= bt
134
- W = UploadMultipleTests.UploadMultipleTests(self.session)
135
+ W = UploadMultipleTests.UploadMultipleTests(self.session, help=HELP_LINK)
135
136
  W.connect("destroy", self.app_closed, bitn)
136
137
 
137
138
  def create_shipment(self, *args):
@@ -142,7 +143,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
142
143
  return
143
144
 
144
145
  self.mask |= bt
145
- W = CreateShipments.CreateShipments(self.session)
146
+ W = CreateShipments.CreateShipments(self.session, help=HELP_LINK)
146
147
  W.connect("destroy", self.app_closed, bitn)
147
148
 
148
149
  def receive_shipment(self, *args):
@@ -153,7 +154,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
153
154
  return
154
155
 
155
156
  self.mask |= bt
156
- W = GetShipments.ReceiveShipments(self.session)
157
+ W = GetShipments.ReceiveShipments(self.session, help=HELP_LINK)
157
158
  W.connect("destroy", self.app_closed, bitn)
158
159
 
159
160
  def petal_gnd(self, *args):
@@ -164,7 +165,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
164
165
  return
165
166
 
166
167
  self.mask |= bt
167
- W = GroundVITests.GroundingTest(self.session)
168
+ W = PetalReceptionTests.PetalReceptionTests(self.session, help=HELP_LINK)
168
169
  W.connect("destroy", self.app_closed, bitn)
169
170
 
170
171
  def glue_weight(self, *args):
@@ -175,7 +176,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
175
176
  return
176
177
 
177
178
  self.mask |= bt
178
- W = GlueWeight.GlueWeight(self.session)
179
+ W = GlueWeight.GlueWeight(self.session, help=HELP_LINK)
179
180
  W.connect("destroy", self.app_closed, bitn)
180
181
 
181
182
  def module_IV(self, *args):
@@ -186,7 +187,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
186
187
  return
187
188
 
188
189
  self.mask |= bt
189
- W = UploadModuleIV.IVwindow(self.session)
190
+ W = UploadModuleIV.IVwindow(self.session, help=HELP_LINK)
190
191
  W.connect("destroy", self.app_closed, bitn)
191
192
 
192
193
  def wire_bond(self, *args):
@@ -197,7 +198,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
197
198
  return
198
199
 
199
200
  self.mask |= bt
200
- W = WireBondGui.WireBond(session=self.session, title="Wirebond")
201
+ W = WireBondGui.WireBond(session=self.session, title="Wirebond", help=HELP_LINK)
201
202
  W.connect("destroy", self.app_closed, bitn)
202
203
 
203
204
  def app_closed(self, *args):
itkdb_gtk/dbGtkUtils.py CHANGED
@@ -4,12 +4,13 @@ import time
4
4
  from collections.abc import Iterable
5
5
  from copy import deepcopy
6
6
  from datetime import datetime
7
+ import webbrowser
7
8
 
8
9
  import dateutil.parser
9
- import gi
10
10
  import numpy as np
11
11
 
12
12
 
13
+ import gi
13
14
  gi.require_version("Gtk", "3.0")
14
15
  from gi.repository import Gtk, GObject, Gio, GLib
15
16
 
@@ -20,6 +21,7 @@ def parse_date(txt):
20
21
 
21
22
  except Exception:
22
23
  return None
24
+
23
25
  def parse_date_as_string(txt):
24
26
  """Parse data and return DB compatible string."""
25
27
  D = parse_date(txt)
@@ -439,7 +441,7 @@ class MessagePanel(object):
439
441
  class ITkDBWindow(Gtk.Window):
440
442
  """Base class for GUI main windows."""
441
443
 
442
- def __init__(self, title="", session=None, show_search=None, gtk_runs=True, panel_size=100):
444
+ def __init__(self, title="", session=None, show_search=None, help=None, gtk_runs=True, panel_size=100):
443
445
  """Initialization.
444
446
 
445
447
  Args:
@@ -455,6 +457,7 @@ class ITkDBWindow(Gtk.Window):
455
457
  self.inst2code = {}
456
458
  self.code2inst = {}
457
459
  self.message_panel = None
460
+ self.help = help
458
461
 
459
462
  if gtk_runs:
460
463
  super().__init__(title=title)
@@ -482,6 +485,15 @@ class ITkDBWindow(Gtk.Window):
482
485
  button.set_tooltip_text(show_search)
483
486
  button.connect("clicked", self.query_db)
484
487
  self.hb.pack_end(button)
488
+
489
+ if self.help:
490
+ button = Gtk.Button()
491
+ icon = Gio.ThemedIcon(name="help-browser-symbolic")
492
+ image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON)
493
+ button.add(image)
494
+ button.connect("clicked", self.show_help)
495
+ self.hb.pack_end(button)
496
+
485
497
 
486
498
  # Create main content box
487
499
  self.mainBox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
@@ -507,6 +519,10 @@ class ITkDBWindow(Gtk.Window):
507
519
  self.hide()
508
520
  self.destroy()
509
521
 
522
+ def show_help(self, *args):
523
+ """Show help"""
524
+ webbrowser.open(self.help)
525
+
510
526
  def query_db(self, *args):
511
527
  """Search button clicked."""
512
528
  pass
@@ -516,7 +532,9 @@ class ITkDBWindow(Gtk.Window):
516
532
  if msg == "<OK>":
517
533
  if hasattr(self.session, "user_gui"):
518
534
  self.session = self.session.user_gui.get_client()
519
- self.userLabel.get_child().set_text(self.session.user.name)
535
+
536
+ if self.userLabel.get_child():
537
+ self.userLabel.get_child().set_text(self.session.user.name)
520
538
 
521
539
  else:
522
540
  self.write_message("Could not login.\n{}".format(msg))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: itkdb_gtk
3
- Version: 0.9.0
3
+ Version: 0.9.1.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
@@ -0,0 +1,28 @@
1
+ itkdb_gtk/CreateShipments.py,sha256=-XG3ayobzVW2pg0hV7cMHTyCjakQOoDTxbCC1YIU43c,13159
2
+ itkdb_gtk/GetShipments.py,sha256=ZHt4kACp6kH5hUL9NAU3cDpDqHw32u4k2VUg08j06FI,18761
3
+ itkdb_gtk/GlueWeight.py,sha256=a6TKCpkkBfH8MNfHFRflnpzUrCOjpNs2kEVXBMkLIgM,12272
4
+ itkdb_gtk/ITkDB.desktop,sha256=v_K4mHsDxb912J1XGo6mOlbW2TkHvYNGrKmiOnsBQqM,172
5
+ itkdb_gtk/ITkDB.svg,sha256=Ry702zrUkxvG61SqThbUNfXySyiLMqalwYpcM-b_KWo,24242
6
+ itkdb_gtk/ITkDBlogin.py,sha256=ciBGBweCKHv31wcEP5DVfdioq_6BcdIs4FPUC0JNF5k,9916
7
+ itkdb_gtk/ITkDButils.py,sha256=holUxg0b-alZXvMl6CiMCCwzvFPg0egMA9ICoph5m40,14861
8
+ itkdb_gtk/PetalReceptionTests.py,sha256=DL1F8rxEdzidMgNIR-gI0qYm6D4NrSCSTRvNg1R4e6w,9273
9
+ itkdb_gtk/SensorUtils.py,sha256=S2Mc-Z1webACisj6waJcMqiqzoGSE7TYScVfxHSD700,15458
10
+ itkdb_gtk/ShowAttachments.py,sha256=Cbvb_N4AxVv5nb8vQLZ4arYRy_06W3Lw9pScOLVo8W4,8407
11
+ itkdb_gtk/ShowComments.py,sha256=e5ywWuK-reFt5bCJ9gqyQdImN8Fue_ch4eWnfjXH3lw,3154
12
+ itkdb_gtk/ShowDefects.py,sha256=tVT5wNe9XI80wnWwUXnKQLHIibgtC8d6C4B4tCDrfJ4,3533
13
+ itkdb_gtk/UploadModuleIV.py,sha256=ixx8DEVi46-71Guyqb3XVQ90nYbvZf3k_-YvD7nBFyE,17749
14
+ itkdb_gtk/UploadMultipleTests.py,sha256=PK0G1eWNYQP56WM2GN6-lmLUuS8TARW1pylo1jZweKs,22142
15
+ itkdb_gtk/UploadPetalInformation.py,sha256=D2Hq-Kesz9vU3fMi7yDuHNUONMRbpVCyxJ1s_81bI-o,22194
16
+ itkdb_gtk/UploadTest.py,sha256=Wohj3d8HyxatMIXNscc7ayvrKUpMR77h6kIw2Or0bFU,16645
17
+ itkdb_gtk/WireBondGui.py,sha256=RM5TrQ3Xvcu18W8DuQJ8oBavau0O7XZOQqExhnoHWCE,25761
18
+ itkdb_gtk/__init__.py,sha256=q1OXLovFhZ9-SkOpYuKH8mrGziMXoQYLnKozZ7TzjcU,1155
19
+ itkdb_gtk/dashBoard.py,sha256=Zsood9ObGJUsr-DOa6QvPkqhoskOVjiMtyHYlREn8mM,6536
20
+ itkdb_gtk/dbGtkUtils.py,sha256=9QCArjREvxSb87dg_zfaz8wS6UaSXG9ClYn2EMeAK8s,25629
21
+ itkdb_gtk/readAVSdata.py,sha256=XJmLpemvOj1B81Jzr-WHZJw4UQphb8LwmZXD82qTWu4,19394
22
+ itkdb_gtk/readGoogleSheet.py,sha256=Lzm_oPWwDqZZzKoBUgsp277F9-wCfr_BA0X4VD2Eolo,2673
23
+ itkdb_gtk/untrash_component.py,sha256=VrN46-f-kF7voOxtoh7OL-bZSWAaIFb7-Xbx6_WT7K8,757
24
+ itkdb_gtk-0.9.1.dev1.dist-info/METADATA,sha256=tmD3TCgr2ldjX6NlMci4OzkBw5B3V-2lSj1D9HgooIk,3154
25
+ itkdb_gtk-0.9.1.dev1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
26
+ itkdb_gtk-0.9.1.dev1.dist-info/entry_points.txt,sha256=p7hiZPp4EPyRNzRdu6NqYlDmfflZGGDiDjIJGOcwfig,445
27
+ itkdb_gtk-0.9.1.dev1.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
28
+ itkdb_gtk-0.9.1.dev1.dist-info/RECORD,,
@@ -2,10 +2,10 @@
2
2
  createShipments = itkdb_gtk:createShipments
3
3
  getShipments = itkdb_gtk:getShipments
4
4
  glueWeight = itkdb_gtk:glueWeight
5
- groundVITests = itkdb_gtk:groundVITests
6
- iploadPetalInformation = itkdb_gtk:uploadPetalInformation
7
5
  itkdb_dashBoard = itkdb_gtk:dash_board
6
+ petalReceptionTests = itkdb_gtk:petalReceptionTests
8
7
  uploadModuleIV = itkdb_gtk:uploadModuleIV
9
8
  uploadMultipleTests = itkdb_gtk:uploadMultipleTests
9
+ uploadPetalInformation = itkdb_gtk:uploadPetalInformation
10
10
  uploadTest = itkdb_gtk:uploadTest
11
11
  wirebondTest = itkdb_gtk:wirebondTest
@@ -1,27 +0,0 @@
1
- itkdb_gtk/CreateShipments.py,sha256=-XG3ayobzVW2pg0hV7cMHTyCjakQOoDTxbCC1YIU43c,13159
2
- itkdb_gtk/GetShipments.py,sha256=T70xpg1NiZOcPuQbdvSEwht4eLFMmqWHFaq3Ls8NKuI,18739
3
- itkdb_gtk/GlueWeight.py,sha256=fp5J54frYdZzje0LJ9y1Q22Dscvg5cXBAXbL8CJMUiQ,12247
4
- itkdb_gtk/GroundVITests.py,sha256=jeIGUHJu3Lul5YcaOOYP_7qwwM738ugpY-Bu_RUfGy0,9214
5
- itkdb_gtk/ITkDB.desktop,sha256=v_K4mHsDxb912J1XGo6mOlbW2TkHvYNGrKmiOnsBQqM,172
6
- itkdb_gtk/ITkDB.svg,sha256=Ry702zrUkxvG61SqThbUNfXySyiLMqalwYpcM-b_KWo,24242
7
- itkdb_gtk/ITkDBlogin.py,sha256=ciBGBweCKHv31wcEP5DVfdioq_6BcdIs4FPUC0JNF5k,9916
8
- itkdb_gtk/ITkDButils.py,sha256=pvLmfhh6g7ulpEfWVbboYBjD4S3qUXSZongG3SWlqAY,14862
9
- itkdb_gtk/ShowAttachments.py,sha256=Cbvb_N4AxVv5nb8vQLZ4arYRy_06W3Lw9pScOLVo8W4,8407
10
- itkdb_gtk/ShowComments.py,sha256=e5ywWuK-reFt5bCJ9gqyQdImN8Fue_ch4eWnfjXH3lw,3154
11
- itkdb_gtk/ShowDefects.py,sha256=tVT5wNe9XI80wnWwUXnKQLHIibgtC8d6C4B4tCDrfJ4,3533
12
- itkdb_gtk/UploadModuleIV.py,sha256=EhUaLze9DLFFKSPclXgCPhxOAL6Cezz3N4xvpnZrc4U,28135
13
- itkdb_gtk/UploadMultipleTests.py,sha256=qvIJzSD7yrIatkOO2_0YrPnL6nPedXtaVoK28H0F18w,22120
14
- itkdb_gtk/UploadPetalInformation.py,sha256=D2Hq-Kesz9vU3fMi7yDuHNUONMRbpVCyxJ1s_81bI-o,22194
15
- itkdb_gtk/UploadTest.py,sha256=wVLZ86fo5Kw1sT7vWjttIVkCNFvPiUcgKhfG3zXw7-Y,16511
16
- itkdb_gtk/WireBondGui.py,sha256=RM5TrQ3Xvcu18W8DuQJ8oBavau0O7XZOQqExhnoHWCE,25761
17
- itkdb_gtk/__init__.py,sha256=_oyuRq0I6WwU15w1bGm7FppXd4fGM5V9H33jemzTbkw,1106
18
- itkdb_gtk/dashBoard.py,sha256=Ahkfkh8fQnAE8gEv24jElDWWJuMqq5-r-ppynbMPm08,6321
19
- itkdb_gtk/dbGtkUtils.py,sha256=vzmYjrmmoRAerELpyWG8XEpjZ5y3L4Oy_or9x70imnQ,25071
20
- itkdb_gtk/readAVSdata.py,sha256=XJmLpemvOj1B81Jzr-WHZJw4UQphb8LwmZXD82qTWu4,19394
21
- itkdb_gtk/readGoogleSheet.py,sha256=Lzm_oPWwDqZZzKoBUgsp277F9-wCfr_BA0X4VD2Eolo,2673
22
- itkdb_gtk/untrash_component.py,sha256=VrN46-f-kF7voOxtoh7OL-bZSWAaIFb7-Xbx6_WT7K8,757
23
- itkdb_gtk-0.9.0.dist-info/METADATA,sha256=syyqetk9udFKkFEeP5SRb5lGd8Hu8aUwkd8N1KM2h_A,3149
24
- itkdb_gtk-0.9.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
25
- itkdb_gtk-0.9.0.dist-info/entry_points.txt,sha256=wrcKQkzsIeLscwbSkO7ua2unUWeCnk4z6lu-OhBpMCo,433
26
- itkdb_gtk-0.9.0.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
27
- itkdb_gtk-0.9.0.dist-info/RECORD,,