itkdb-gtk 0.10.10.dev9__py3-none-any.whl → 0.11.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/GetShipments.py CHANGED
@@ -136,6 +136,12 @@ class ReceiveShipments(dbGtkUtils.ITkDBWindow):
136
136
  btn.connect("clicked", self.receive_items)
137
137
  grid.attach(btn, 2, 3, 1, 1)
138
138
 
139
+ self.check_all = Gtk.ToggleButton(label="Check A_ll", use_underline=True)
140
+ self.check_all.set_active(1)
141
+ self.check_all.set_tooltip_text("If toggled, items will need to be `received`\none by one by unchecking the check box.")
142
+ grid.attach(self.check_all, 3, 3, 1, 1)
143
+
144
+
139
145
  # Add a Separator
140
146
  self.mainBox.pack_start(Gtk.Separator(orientation=Gtk.Orientation.VERTICAL), False, True, 0)
141
147
 
@@ -300,34 +306,46 @@ class ReceiveShipments(dbGtkUtils.ITkDBWindow):
300
306
  else:
301
307
  self.cmb_shipment.set_active(-1)
302
308
  self.cmb_shipment.get_child().set_text("")
309
+ self.tree.set_model(Gtk.ListStore(str, str, str, bool))
303
310
 
311
+ def mark_all_as_delivered(self):
312
+ """Mark all items in current shipment as delivered."""
313
+ if self.store is None:
314
+ return
304
315
 
305
- self.tree.set_model(Gtk.ListStore(str, str, str, bool))
316
+ lv_iter = self.store.get_iter_first()
317
+ while lv_iter:
318
+ val = self.store[lv_iter][3]
319
+ self.store[lv_iter][3] = not val
320
+ lv_iter = self.store.iter_next(lv_iter)
306
321
 
307
322
  def receive_items(self, *args):
308
323
  """Receive shipment items."""
309
324
  data = {}
310
325
  names = {}
326
+ if not self.store:
327
+ self.write_message("Empty list of items.\n")
328
+ return
311
329
 
312
- # self.store is the model of the tree view
313
- if self.store:
314
- lv_iter = self.store.get_iter_first()
315
- while lv_iter:
316
- shpmnt = self.store.get_value(lv_iter, 2)
317
- if shpmnt not in data:
318
- data[shpmnt] = create_shipment_status(shpmnt)
319
- names[shpmnt] = self.store.get_value(lv_iter, 4)
330
+ if not self.check_all.get_active():
331
+ self.mark_all_as_delivered()
320
332
 
321
- item = {
322
- "code": self.store[lv_iter][5],
323
- "delivered": not self.store[lv_iter][3]
324
- }
325
- data[shpmnt]["shipmentItems"].append(item)
333
+ # self.store is the model of the tree view
334
+ lv_iter = self.store.get_iter_first()
335
+ while lv_iter:
336
+ shpmnt = self.store.get_value(lv_iter, 2)
337
+ if shpmnt not in data:
338
+ data[shpmnt] = create_shipment_status(shpmnt)
339
+ names[shpmnt] = self.store.get_value(lv_iter, 4)
340
+
341
+ item = {
342
+ "code": self.store[lv_iter][5],
343
+ "delivered": not self.store[lv_iter][3]
344
+ }
345
+ data[shpmnt]["shipmentItems"].append(item)
326
346
 
327
- lv_iter = self.store.iter_next(lv_iter)
347
+ lv_iter = self.store.iter_next(lv_iter)
328
348
 
329
- else:
330
- self.write_message("Empty list of items.\n")
331
349
 
332
350
  for oid, S in data.items():
333
351
  # Check that all items are there
itkdb_gtk/GlueWeight.py CHANGED
@@ -13,7 +13,7 @@ except ImportError:
13
13
  cwd = Path(__file__).parent.parent
14
14
  sys.path.append(cwd.as_posix())
15
15
 
16
- from itkdb_gtk import dbGtkUtils, ITkDBlogin, ITkDButils
16
+ from itkdb_gtk import dbGtkUtils, ITkDBlogin, ITkDButils, UploadMultipleTests
17
17
  HELP_LINK="https://itkdb-gtk.docs.cern.ch"
18
18
 
19
19
 
@@ -332,22 +332,20 @@ class GlueWeight(dbGtkUtils.ITkDBWindow):
332
332
 
333
333
  def upload_tests(self):
334
334
  """Upload tests to DB."""
335
+ W = UploadMultipleTests.UploadMultipleTests(
336
+ self.session,
337
+ help_link="{}/uploadMultipleTests.html".format(HELP_LINK)
338
+ )
339
+
335
340
  if len(self.test_list)>0:
336
341
  for G in self.test_list:
337
342
  m = G.values
338
- print("### Uploading {} for module {}".format(m["testType"], m["component"]))
339
- resp = ITkDButils.upload_test(self.session, m)
340
-
341
- if resp is not None:
342
- print(resp)
343
+ W.add_test_data_to_view(m)
344
+
343
345
 
344
346
  else:
345
347
  for m in self.modules:
346
- print("### Uploading {} for module {}".format(m["testType"], m["component"]))
347
- resp = ITkDButils.upload_test(self.session, m)
348
-
349
- if resp is not None:
350
- print(resp)
348
+ W.add_test_data_to_view(m)
351
349
 
352
350
 
353
351
  def main():
itkdb_gtk/ITkDButils.py CHANGED
@@ -298,11 +298,11 @@ def upload_test(client, data, attachments=None, check_runNumber=False):
298
298
 
299
299
  if data["runNumber"] in runN:
300
300
  # if the given runNumber is there, try to create a new one.
301
- print("runNumber {} already in {} of {}".format(data["runNumber"], data["testType"], data["component"]))
301
+ #print("runNumber {} already in {} of {}".format(data["runNumber"], data["testType"], data["component"]))
302
302
  try:
303
303
  irun = int(data["runNumber"])
304
304
  for i in range(irun+1, 100):
305
- newRn = "{}".format(i+1)
305
+ newRn = "{}".format(i)
306
306
  if newRn not in runN:
307
307
  data["runNumber"] = newRn
308
308
  break
@@ -468,73 +468,81 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
468
468
  self.write_message("Something went wrong with the stages\n")
469
469
  return [None, None]
470
470
 
471
+ def add_test_data_to_view(self, data, ifile=None, folder=None):
472
+ """Add a test data to the tree view."""
473
+ has_errors = False
474
+ default_site = None
475
+
476
+ errors, missing = check_data(data)
477
+ if len(missing) > 0:
478
+ self.write_message("Some keys are missing in the JSon file.\n")
479
+ self.write_message("{}\n".format("\n".join(['\t'+line for line in missing])))
480
+
481
+ if "institution" in missing and len(missing) == 1:
482
+ if default_site is None:
483
+ site, use_default = self.get_test_institute()
484
+ if use_default:
485
+ default_site = site
486
+ else:
487
+ site = default_site
488
+
489
+ if site:
490
+ data["institution"] = site
491
+ self.write_message("Setting Institution to {}\n".format(data["institution"]))
492
+
493
+ else:
494
+ has_errors = True
495
+ dbGtkUtils.complain("Invalid JSON file\n{}".format('\n'.join(errors)),"--")
496
+
497
+ if not has_errors:
498
+ attachments = []
499
+ if "attachments" in data:
500
+ for att in data["attachments"]:
501
+ path = Path(att["path"])
502
+ if path.exists():
503
+ path = path.expanduser().resolve()
504
+ else:
505
+ if folder is not None:
506
+ path = folder / path.name
507
+
508
+ if path.exists():
509
+ attachments.append(ITkDButils.Attachment(path=path,
510
+ title=att["title"],
511
+ desc=att["description"]))
512
+ else:
513
+ self.write_message("Ignoring atachment {}".format(data["path"]))
514
+
515
+ # We need to delete this, which is "unofficial"
516
+ del data["attachments"]
517
+
518
+ model = self.tree.get_model()
519
+ comments = data.get("comments", [])
520
+ defects = data.get("defects", [])
521
+ the_date = handle_test_date(data["date"])
522
+ combo, currentStage = self.get_component_stages(data["component"])
523
+ if data["passed"]:
524
+ if data["problems"]:
525
+ color = "orange"
526
+ else:
527
+ color = self.def_color
528
+ else:
529
+ color = "firebrick"
530
+
531
+ model.append([data["component"], data["testType"], data["runNumber"], the_date,
532
+ data["institution"], currentStage, currentStage,
533
+ ifile, data, len(attachments), attachments,
534
+ len(comments), comments, len(defects), defects, color])
535
+
471
536
  def add_tests_to_view(self, files):
472
537
  """Add the input fiels to the treeview."""
473
- default_site = None
474
538
  for ifile in files:
475
539
  try:
476
- has_errors = False
477
- data = json.loads(open(ifile, 'r', encoding="UTF-8").read())
478
- errors, missing = check_data(data)
479
- if len(missing) > 0:
480
- self.write_message("{}\n".format(Path(ifile).name))
481
- self.write_message("Some keys are missing in the JSon file.\n")
482
- self.write_message("{}\n".format("\n".join(['\t'+line for line in missing])))
483
-
484
- if "institution" in missing and len(missing) == 1:
485
- if default_site is None:
486
- site, use_default = self.get_test_institute()
487
- if use_default:
488
- default_site = site
489
- else:
490
- site = default_site
491
-
492
- if site:
493
- data["institution"] = site
494
- self.write_message("Setting Institution to {}\n".format(data["institution"]))
540
+ self.write_message("{}\n".format(Path(ifile).name))
541
+ folder = Path(ifile).parent
495
542
 
496
- else:
497
- has_errors = True
498
- dbGtkUtils.complain("Invalid JSON file\n{}".format('\n'.join(errors)), ifile)
499
-
500
- if not has_errors:
501
- attachments = []
502
- if "attachments" in data:
503
- folder = Path(ifile).parent
504
- for att in data["attachments"]:
505
- path = Path(att["path"])
506
- if path.exists():
507
- path = path.expanduser().resolve()
508
- else:
509
- path = folder / path.name
510
-
511
- if path.exists():
512
- attachments.append(ITkDButils.Attachment(path=path,
513
- title=att["title"],
514
- desc=att["description"]))
515
- else:
516
- self.write_message("Ignoring atachment {}".format(data["path"]))
517
-
518
- # We need to delete tis, which is "unofficial"
519
- del data["attachments"]
520
-
521
- model = self.tree.get_model()
522
- comments = data.get("comments", [])
523
- defects = data.get("defects", [])
524
- the_date = handle_test_date(data["date"])
525
- combo, currentStage = self.get_component_stages(data["component"])
526
- if data["passed"]:
527
- if data["problems"]:
528
- color = "orange"
529
- else:
530
- color = self.def_color
531
- else:
532
- color = "firebrick"
543
+ data = json.loads(open(ifile, 'r', encoding="UTF-8").read())
544
+ self.add_test_data_to_view(data, ifile=ifile, folder=folder)
533
545
 
534
- model.append([data["component"], data["testType"], data["runNumber"], the_date,
535
- data["institution"], currentStage, currentStage,
536
- ifile, data, len(attachments), attachments,
537
- len(comments), comments, len(defects), defects, color])
538
546
 
539
547
  except Exception as E:
540
548
  self.write_message("Cannot load file {}\n".format(ifile))
itkdb_gtk/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """ itkdb-gtk python module
2
2
  """
3
- __version__ = "0.10.10.dev9"
3
+ __version__ = "0.11.0"
4
4
 
5
5
 
6
6
  def dash_board():
itkdb_gtk/dashBoard.py CHANGED
@@ -341,10 +341,13 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
341
341
 
342
342
  self.mask |= bt
343
343
  opt = IRPetalParam()
344
+ opt.files = []
345
+ opt.golden = None
344
346
  opt.folder = None
345
347
  opt.out = None
346
348
  opt.alias = None
347
349
  opt.SN = None
350
+ opt.desy = False
348
351
  W = CoreThermal(opt, self.session, title="Petal Thermal Test.")
349
352
  W.connect("destroy", self.app_closed, bitn)
350
353
  W.show_all()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: itkdb_gtk
3
- Version: 0.10.10.dev9
3
+ Version: 0.11.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
@@ -1,10 +1,10 @@
1
1
  itkdb_gtk/CreateShipments.py,sha256=eiVjw7zGLGAoqWxThBc6IVvXLUFXmtQ-_hpZzfDOKx0,13249
2
- itkdb_gtk/GetShipments.py,sha256=tEGWAmfW86jiAkc6cflVWR2QpKwhOLSRZicwwcfQVKw,18465
3
- itkdb_gtk/GlueWeight.py,sha256=OSc5EJjyzgZC9sk21L7K_gs88peSrEcC2CWbl1uNXTU,11749
2
+ itkdb_gtk/GetShipments.py,sha256=b3TECQhHlK0kGXH6KjQs06yuzIfTN5tjtiu6wnEOuJ8,19172
3
+ itkdb_gtk/GlueWeight.py,sha256=IHgvbN2DlT8Ou-DMi-n3Z-3xSrPr0tlrkkEH10AshrA,11587
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
- itkdb_gtk/ITkDButils.py,sha256=WYjE_DOnFJdxhhQ5ylVTupIOjrp2r83jQALa0Gc2xZg,19587
7
+ itkdb_gtk/ITkDButils.py,sha256=p1r1HqY0hP47Y0fRRweLPNR6rbPRebWS8d9y_vdj_lk,19586
8
8
  itkdb_gtk/PanelVisualInspection.py,sha256=ktAcYbdLBS7Zbxq9XsxB_AWTgAfFLa42NFTEsxnBn98,20531
9
9
  itkdb_gtk/PetalReceptionTests.py,sha256=N9_lBvao-HeHPwccjycUL7p3R3V_nPur1WibXbcqjgI,9992
10
10
  itkdb_gtk/SensorUtils.py,sha256=fYWF9TeutAbore53dLWNlZnVn9P3OsKYcFLNGOs8cnI,15426
@@ -12,17 +12,17 @@ itkdb_gtk/ShowAttachments.py,sha256=KExxPCdbcb04XS8JSUkg5xF1McvlB8e9btwctDCKNXU,
12
12
  itkdb_gtk/ShowComments.py,sha256=OiMTFLnhGbbKRj5x61D517BYHAt-qY5Y1lvR3EQz3c0,3151
13
13
  itkdb_gtk/ShowDefects.py,sha256=aVAHeaE5IztmAPEuHwhi06KWo_pi9xX2J1fTLhKyAPI,3530
14
14
  itkdb_gtk/UploadModuleIV.py,sha256=sqh52bSxANBwlmVWZlDqFXpqRGf0rV0QsjJWC-tY_qI,17792
15
- itkdb_gtk/UploadMultipleTests.py,sha256=EaDM5t_-tkGlgg66Nb36iGN7dT3-wvsrWwChpbXGML0,24287
15
+ itkdb_gtk/UploadMultipleTests.py,sha256=TFEqcRd2ZZAVhK3P3Qn2vg81NouOCjkjqn9PhoHYhPM,24125
16
16
  itkdb_gtk/UploadTest.py,sha256=ukgJ5-IG12bqa1QIp3bXIV8hkdXCv5UDxh1lQswN_ko,16832
17
17
  itkdb_gtk/VisualInspection.py,sha256=i2i_9ttetMzGFRcBFm_ow7aziksTgvZzVLUxZhwiyBg,9850
18
18
  itkdb_gtk/WireBondGui.py,sha256=WFTLOw4l5JxSbvh4vZMxcF65fqlwvNw0fOyEru9ijqQ,39850
19
- itkdb_gtk/__init__.py,sha256=23qH2hGi_hozwXJbDTvLWJZWyRACKFft-8KsRf5TdCc,1269
20
- itkdb_gtk/dashBoard.py,sha256=b2QmPUtjo_gAxf3u5t5_V35J580i9V-4FLr2NvmDzAw,10999
19
+ itkdb_gtk/__init__.py,sha256=T-1R2QGY5NH5Yc1rSoWlZ4NwEtokbXv1TQfg_r_c8gA,1263
20
+ itkdb_gtk/dashBoard.py,sha256=VtD7w9FqexYEdihXCw6rxIZrjChQPyJ1LT4DsT3-K2k,11073
21
21
  itkdb_gtk/dbGtkUtils.py,sha256=THW-IT5UJB1YluvUVIfpy6oIY2faSHChNKGTpY5qzag,30480
22
22
  itkdb_gtk/readGoogleSheet.py,sha256=Lzm_oPWwDqZZzKoBUgsp277F9-wCfr_BA0X4VD2Eolo,2673
23
23
  itkdb_gtk/untrash_component.py,sha256=VrN46-f-kF7voOxtoh7OL-bZSWAaIFb7-Xbx6_WT7K8,757
24
- itkdb_gtk-0.10.10.dev9.dist-info/METADATA,sha256=FjbmJX0AH9AFQCI15uwKoWwlg7qZPzOjbr5m_npnetM,3156
25
- itkdb_gtk-0.10.10.dev9.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
26
- itkdb_gtk-0.10.10.dev9.dist-info/entry_points.txt,sha256=51wi4BRW1vYuLNySWC6bsmQPo7XPI7cvPFAaBD49Ib0,489
27
- itkdb_gtk-0.10.10.dev9.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
28
- itkdb_gtk-0.10.10.dev9.dist-info/RECORD,,
24
+ itkdb_gtk-0.11.0.dist-info/METADATA,sha256=fQrQBCNU8wtqG-e8HDm7PHGm-f6soglsHvqH6uWZRuM,3150
25
+ itkdb_gtk-0.11.0.dist-info/WHEEL,sha256=a7TGlA-5DaHMRrarXjVbQagU3Man_dCnGIWMJr5kRWo,91
26
+ itkdb_gtk-0.11.0.dist-info/entry_points.txt,sha256=51wi4BRW1vYuLNySWC6bsmQPo7XPI7cvPFAaBD49Ib0,489
27
+ itkdb_gtk-0.11.0.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
28
+ itkdb_gtk-0.11.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5