itkdb-gtk 0.10.10.dev1__py3-none-any.whl → 0.10.10.dev2__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.

@@ -19,7 +19,7 @@ from itkdb_gtk import dbGtkUtils, ITkDBlogin, ITkDButils
19
19
 
20
20
  import gi
21
21
  gi.require_version("Gtk", "3.0")
22
- from gi.repository import Gtk, Gio, GLib
22
+ from gi.repository import Gtk, Gio
23
23
 
24
24
  # Check if Gtk can be open
25
25
  gtk_runs, gtk_args = Gtk.init_check()
@@ -181,6 +181,9 @@ class CreateShipments(dbGtkUtils.ITkDBWindow):
181
181
  # For the later we get the SN in the argument list.
182
182
  if isinstance(args[0], Gtk.Button):
183
183
  txt = dbGtkUtils.get_a_value("Enter item SN", is_tv=True)
184
+ if txt is None:
185
+ return
186
+
184
187
  tmp = re.split(';|,| |\n|\t', txt)
185
188
  SNlist = [s.strip() for s in tmp if len(s.strip())>0]
186
189
  else:
@@ -346,7 +349,7 @@ class CreateShipments(dbGtkUtils.ITkDBWindow):
346
349
  self.tree.set_model(model)
347
350
  self.comments.set_text("")
348
351
  self.name.set_text("")
349
- self.attachments = None
352
+ self.attachment = None
350
353
 
351
354
  else:
352
355
  self.write_message("Empty list of items when creating shipment.")
itkdb_gtk/GetShipments.py CHANGED
@@ -96,7 +96,7 @@ class ReceiveShipments(dbGtkUtils.ITkDBWindow):
96
96
  self.mainBox.pack_start(grid, False, True, 0)
97
97
 
98
98
  # The shipment receiver
99
- receiver = self.create_institute_combo()
99
+ receiver = self.create_institute_combo(only_user=True)
100
100
  receiver.connect("changed", self.on_receiver)
101
101
  receiver.set_tooltip_text("Select the Institute receiving the items.")
102
102
  dbGtkUtils.set_combo_iter(receiver, self.recipient)
@@ -256,7 +256,7 @@ class ReceiveShipments(dbGtkUtils.ITkDBWindow):
256
256
 
257
257
  def query_db(self, *args):
258
258
  """Query for shipments in DB."""
259
- if self.institute is None or self.state == "":
259
+ if self.state == "":
260
260
  return
261
261
 
262
262
  payload = {
@@ -272,7 +272,11 @@ class ReceiveShipments(dbGtkUtils.ITkDBWindow):
272
272
  # the tree view.
273
273
  cmb_store = Gtk.ListStore(str, str)
274
274
  for s in shpmts:
275
- if s["recipient"]["code"] == self.recipient and s['sender']['code'] == self.institute:
275
+ valid_sender = True
276
+ if self.institute is not None:
277
+ valid_sender = s['sender']['code'] == self.institute
278
+
279
+ if s["recipient"]["code"] == self.recipient and valid_sender:
276
280
  store = self.get_tree_view_model()
277
281
  cmb_store.append([s['name'], s['id']])
278
282
  items = self.session.get("listShipmentItems", json={"shipment": s["id"]})
@@ -290,8 +294,15 @@ class ReceiveShipments(dbGtkUtils.ITkDBWindow):
290
294
  self.write_message("Could not find any shipment in DB.\n")
291
295
 
292
296
  self.cmb_shipment.set_model(cmb_store)
293
- self.cmb_shipment.set_entry_text_column(0)
294
- self.cmb_shipment.set_active(0)
297
+ if len(cmb_store)>0:
298
+ self.cmb_shipment.set_entry_text_column(0)
299
+ self.cmb_shipment.set_active(0)
300
+ else:
301
+ self.cmb_shipment.set_active(-1)
302
+ self.cmb_shipment.get_child().set_text("")
303
+
304
+
305
+ self.tree.set_model(Gtk.ListStore(str, str, str, bool))
295
306
 
296
307
  def receive_items(self, *args):
297
308
  """Receive shipment items."""
@@ -64,7 +64,7 @@ class PanelVisualInspection(dbGtkUtils.ITkDBWindow):
64
64
  self.mainBox.pack_start(grid, False, False, 5)
65
65
 
66
66
  irow = 0
67
- receiver = self.create_institute_combo()
67
+ receiver = self.create_institute_combo(only_user=True)
68
68
  receiver.connect("changed", self.on_institute)
69
69
  receiver.set_tooltip_text("Select the Institute making the test.")
70
70
  dbGtkUtils.set_combo_iter(receiver, self.institute)
@@ -84,7 +84,7 @@ class PetalReceptionTests(dbGtkUtils.ITkDBWindow):
84
84
  grid.attach(lbl, 0, 1, 1, 1)
85
85
 
86
86
  self.institute = self.pdb_user["institutions"][0]["code"]
87
- inst = self.create_institute_combo()
87
+ inst = self.create_institute_combo(only_user=True)
88
88
  inst.connect("changed", self.new_institute)
89
89
  inst.set_tooltip_text("Select the Institute.")
90
90
  grid.attach(inst, 1, 1, 1, 1)
itkdb_gtk/WireBondGui.py CHANGED
@@ -15,7 +15,6 @@ try:
15
15
  import itkdb_gtk
16
16
 
17
17
  except ImportError:
18
- from pathlib import Path
19
18
  cwd = Path(__file__).parent.parent
20
19
  sys.path.append(cwd.as_posix())
21
20
  import itkdb_gtk
@@ -33,7 +32,7 @@ def range_to_list(V):
33
32
  """Convert a range (ch1-ch2) to a list."""
34
33
  if '-' not in V:
35
34
  return [V]
36
-
35
+
37
36
  out = []
38
37
  endpoints = list(map(int, V.split('-')))
39
38
  endpoints.sort()
@@ -449,6 +448,7 @@ class WireBond(dbGtkUtils.ITkDBWindow):
449
448
  self.combo = None
450
449
  self.tree = None
451
450
  self.lut = {}
451
+ self.module_type = None
452
452
  self.init_window()
453
453
 
454
454
  def init_window(self):
@@ -571,54 +571,65 @@ class WireBond(dbGtkUtils.ITkDBWindow):
571
571
  dbGtkUtils.complain("Cannot open Luukup Table.",
572
572
  "File {} does not exist.".format(fnam))
573
573
  return
574
-
574
+
575
575
  lut = {}
576
+ module_map = {}
577
+ section = None
576
578
  with open(fnam, 'r', encoding="UTF-8") as fin:
577
579
  for line in fin:
578
580
  line = line.strip()
579
-
580
- if len(line) == 0:
581
- continue
582
-
581
+
583
582
  # Remove comments.
584
- if line[0]=='#':
585
- continue
586
-
587
583
  ipos = line.find('#')
588
584
  if ipos >= 0:
589
585
  line = line[:ipos].strip()
590
-
586
+
591
587
  if len(line) == 0:
592
588
  continue
593
-
589
+
590
+ # Check for new section
591
+ ipos = line.find(':')
592
+ if ipos >= 0:
593
+ section = line[:ipos].strip().upper()
594
+ if section in module_map:
595
+ dbGtkUtils.complain("Section {} already in map.".format(section), "Stop parsing bond Lookup table.")
596
+ return
597
+
598
+ lut = {}
599
+ module_map[section] = lut
600
+ continue
601
+
602
+ if section is None:
603
+ continue
604
+
594
605
  values = list(map(str.strip, line.split(',')))
595
606
  if len(values)!=2:
596
607
  dbGtkUtils.complain("Cannot read Lookup table.", "Wrong line format: {}".format(line))
597
608
  return
598
-
609
+
599
610
  v_local = range_to_list(values[0])
600
611
  v_std = range_to_list(values[1])
601
-
612
+
602
613
  if len(v_local) != len(v_std):
603
- dbGtkUtils.complain("Wrong Lookup table.",
614
+ dbGtkUtils.complain("Wrong Lookup table.",
604
615
  "Ranges have different length: {}".format(line))
605
616
  return
606
-
617
+
607
618
  for L, S in zip(v_local, v_std):
608
619
  lut[L] = S
609
-
610
- self.lut = lut
620
+
621
+ self.lut = module_map
611
622
 
612
623
  def convert_channel(self, C):
613
624
  """Convert channel according to LUT
614
625
 
615
626
  Args:
616
627
  C (str): channel number
617
-
628
+
618
629
  """
619
630
  try:
620
- return self.lut[C]
621
-
631
+ return self.lut[self.module_type][C]
632
+
622
633
  except KeyError:
623
634
  return C
624
635
 
@@ -631,13 +642,20 @@ class WireBond(dbGtkUtils.ITkDBWindow):
631
642
  def on_SN_changed(self, entry, value):
632
643
  """New SN given. Ask in PDB,"""
633
644
  if len(value) <= 0:
634
- return None
635
-
645
+ return
636
646
 
637
647
  obj = itkdb_gtk.ITkDButils.get_DB_component(self.session, value)
638
648
  if obj is not None and obj["serialNumber"] is not None:
639
649
  entry.set_text(obj["serialNumber"])
640
- self.alternativeID = obj["alternativeIdentifier"]
650
+ alternativeID = obj["alternativeIdentifier"]
651
+ module_SN = obj["serialNumber"]
652
+ if len(module_SN) == 14 and module_SN.startswith("20USEM"):
653
+ self.module_SN = module_SN
654
+ self.alternativeID = alternativeID
655
+ self.module_type = module_SN[5:7]
656
+
657
+ else:
658
+ itkdb_gtk.dbGtkUtils.complain("Invalid SN: {}".format(module_SN), "Not a Ring module")
641
659
 
642
660
  else:
643
661
  itkdb_gtk.dbGtkUtils.complain("Invalid SN", value)
@@ -948,7 +966,7 @@ class WireBond(dbGtkUtils.ITkDBWindow):
948
966
  values = list(map(str.strip, key.split(',')))
949
967
  if ',' in key or '-' in key:
950
968
  range_items.append(key)
951
-
969
+
952
970
  else:
953
971
  continue
954
972
 
itkdb_gtk/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """ itkdb-gtk python module
2
2
  """
3
- __version__ = "0.10.10.dev1"
3
+ __version__ = "0.10.10.dev2"
4
4
 
5
5
 
6
6
  def dash_board():
itkdb_gtk/dbGtkUtils.py CHANGED
@@ -246,6 +246,7 @@ class TextEntry(GObject.GObject):
246
246
  GObject.GObject.__init__(self)
247
247
  self.tmp_txt = ""
248
248
  self.nlines = n_lines
249
+ self.do_emit = True
249
250
  if self.nlines > 1:
250
251
  self.widget = Gtk.Frame()
251
252
  scrolled = Gtk.ScrolledWindow()
@@ -265,7 +266,6 @@ class TextEntry(GObject.GObject):
265
266
 
266
267
  self.widget.connect("focus-in-event", self.on_enter)
267
268
  self.widget.connect("focus-out-event", self.on_leave)
268
-
269
269
  self.entry = self.widget
270
270
 
271
271
  def do_my_signal(self, *args):
@@ -281,7 +281,9 @@ class TextEntry(GObject.GObject):
281
281
  """On leave."""
282
282
  val = self.widget.get_text().strip()
283
283
  if val != self.tmp_txt:
284
+ self.do_emit = False
284
285
  self.emit("text_changed", val)
286
+ self.do_emit = True
285
287
 
286
288
  def get_text(self):
287
289
  """Return the text."""
@@ -303,7 +305,10 @@ class TextEntry(GObject.GObject):
303
305
  self.entry.get_buffer().set_text(text)
304
306
  else:
305
307
  self.entry.set_text(text)
306
-
308
+ if self.do_emit:
309
+ self.do_emit = False
310
+ self.emit("text_changed", text)
311
+ self.do_emit = True
307
312
 
308
313
  def get_a_value(main_title, second_text=None, is_tv=False, parent=None):
309
314
  """Open a dialog to get a value.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: itkdb_gtk
3
- Version: 0.10.10.dev1
3
+ Version: 0.10.10.dev2
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,12 +1,12 @@
1
- itkdb_gtk/CreateShipments.py,sha256=BC87vSINAgzCFkeisBn54NMUPm-jN0ysOA0JBj6m1Uo,13102
2
- itkdb_gtk/GetShipments.py,sha256=qrQFXZYo48LzlSWGERsi1qCaerDGrlHJ4ZR-QqpzuGg,18049
1
+ itkdb_gtk/CreateShipments.py,sha256=6m66OsURF_c2IgpfYfvSwu3hlhlQV8vVv7EqQQQNzds,13147
2
+ itkdb_gtk/GetShipments.py,sha256=8E0QG-sH2gygqCAJFhpXJnH3QAjO_62havm9hJuX-Uk,18414
3
3
  itkdb_gtk/GlueWeight.py,sha256=tyF5-EAc6QkOLo9ZRp807Xx6zK6yYBGElvfmpUYeuUA,12284
4
4
  itkdb_gtk/ITkDB.desktop,sha256=v_K4mHsDxb912J1XGo6mOlbW2TkHvYNGrKmiOnsBQqM,172
5
5
  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=SCp9NFAFcNM_9m2PCEYdnn3SJDU7JhDAXFcBWkgR6es,19201
8
- itkdb_gtk/PanelVisualInspection.py,sha256=J9I8sEH899xckcTi-zUJ2v7bxqU6sDXliUU8TYhtaRc,20209
9
- itkdb_gtk/PetalReceptionTests.py,sha256=4yCL6gsHouAUNK9BGYMQ3oOK_LaCOHnIfDHPidsXC9M,9889
8
+ itkdb_gtk/PanelVisualInspection.py,sha256=UdY40fre5EEIr4XHRmvbP0JkDP00HvNApX2CbImA_vw,20223
9
+ itkdb_gtk/PetalReceptionTests.py,sha256=Ta3gGa_pFcOSroF2xpPyAT5nfhXAouBHcfDgPXCvwJI,9903
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
@@ -15,15 +15,15 @@ itkdb_gtk/UploadModuleIV.py,sha256=sqh52bSxANBwlmVWZlDqFXpqRGf0rV0QsjJWC-tY_qI,1
15
15
  itkdb_gtk/UploadMultipleTests.py,sha256=U94u9WJLeHPgBKT2lPOCxTaXf1Rv19mb5VzLq6bYPwA,22531
16
16
  itkdb_gtk/UploadPetalInformation.py,sha256=N0OgGcbjB6uagUUJVwSNhuNPnGHh8PtqjOm2BncrYxI,25874
17
17
  itkdb_gtk/UploadTest.py,sha256=g2NohkkRNJXsaODncyR6hnYpawURA6VBSqFe1Zg-h2A,16641
18
- itkdb_gtk/WireBondGui.py,sha256=X2MIYXSTzz6odjkx-XGUYbbcWNuZQvbIC18RxVgmNvY,32956
19
- itkdb_gtk/__init__.py,sha256=Ax7S_uyK8PeTfLYfnB26IWSU2hiD2XVyV_ySxcETXVs,1292
18
+ itkdb_gtk/WireBondGui.py,sha256=lG4eH8CNEf15yiEZ7l7bDayw3zOaKGKx2JGB-IcEBa0,33601
19
+ itkdb_gtk/__init__.py,sha256=i12_VChfdfkF1EGhwYDYxWBggWEvdC_RaQ0zKFRdm0o,1292
20
20
  itkdb_gtk/dashBoard.py,sha256=FOmp0hwToN5Lo3cHf1a5RZv6fP9EsIs462PJErtz7Pw,9010
21
- itkdb_gtk/dbGtkUtils.py,sha256=aM-XY3zWyrCwodBKPNZxIOYkRgA0K8w8HZonAWXS6tg,30239
21
+ itkdb_gtk/dbGtkUtils.py,sha256=THW-IT5UJB1YluvUVIfpy6oIY2faSHChNKGTpY5qzag,30480
22
22
  itkdb_gtk/readAVSdata.py,sha256=NFJ7XYUeKbTxPKfu0kEjq8wBErS88bCFmNpjQyA2jcM,23478
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.10.10.dev1.dist-info/METADATA,sha256=VQdXKrtGEOirYAsypcUB_VE7c-8TP2Q-nHFaYWS7Lqc,3156
26
- itkdb_gtk-0.10.10.dev1.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
27
- itkdb_gtk-0.10.10.dev1.dist-info/entry_points.txt,sha256=Xf_DDU3QlT2zogRFMOJdO4BdVuAKyAwmb2jHZ5KbBxE,501
28
- itkdb_gtk-0.10.10.dev1.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
29
- itkdb_gtk-0.10.10.dev1.dist-info/RECORD,,
25
+ itkdb_gtk-0.10.10.dev2.dist-info/METADATA,sha256=WyyCA5_haMqUfVR-8Fnm3RY277UepK90rrGWOyENJFA,3156
26
+ itkdb_gtk-0.10.10.dev2.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
27
+ itkdb_gtk-0.10.10.dev2.dist-info/entry_points.txt,sha256=Xf_DDU3QlT2zogRFMOJdO4BdVuAKyAwmb2jHZ5KbBxE,501
28
+ itkdb_gtk-0.10.10.dev2.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
29
+ itkdb_gtk-0.10.10.dev2.dist-info/RECORD,,