itkdb-gtk 0.12.0__py3-none-any.whl → 0.14.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/ITkDButils.py CHANGED
@@ -90,6 +90,39 @@ def get_db_date(timestamp=None):
90
90
  return out
91
91
 
92
92
 
93
+
94
+ def get_petal_core_batches(session):
95
+ """Get list of Petal core batches"""
96
+ payload = {
97
+ "filterMap": {
98
+ "project": "S",
99
+ "batchType": ["PETAL_CORE_BATCH_TYPE"],
100
+ }
101
+ }
102
+ batch_list = session.get("listBatches", json=payload)
103
+ rc = {}
104
+ for B in batch_list:
105
+ rc[B["number"] ]= B["id"]
106
+
107
+ return rc
108
+
109
+ def set_petal_core_batch(session, petal_core):
110
+ """Set the batch of the petal core."""
111
+ if petal_core["type"]["code"] != "CORE_AVS":
112
+ return
113
+
114
+ batch_list = get_petal_core_batches(session)
115
+ aliasID = petal_core["alternativeIdentifier"]
116
+ if "PPB" in aliasID:
117
+ batch_code = "PETAL_CORE_PREPROD"
118
+ elif "PPC" in aliasID:
119
+ batch_code = "PETAL_CORE_PROD"
120
+ else:
121
+ batch_code = "PETAL_CORE_PROTO"
122
+
123
+ rc = session.post("addBatchComponent", json={"id":batch_list[batch_code], "component": petal_core["id"]})
124
+ return rc
125
+
93
126
  def registerPetalCore(client, SN, alias, HC_id=None):
94
127
  """Register a Petal Core in the DB.
95
128
 
@@ -115,14 +148,14 @@ def registerPetalCore(client, SN, alias, HC_id=None):
115
148
  if HC_id is not None:
116
149
  dto["properties"]["HC_ID"] = HC_id
117
150
 
118
- db_response = client.post('registerComponent', json=dto)
119
151
  try:
152
+ db_response = client.post('registerComponent', json=dto)
153
+ set_petal_core_batch(client, db_response["component"])
120
154
  return db_response['component']
121
155
 
122
156
  except KeyError:
123
157
  return None
124
158
 
125
-
126
159
  def create_component_attachment(client, SN, file_path, title=None, description="", item_type="component"):
127
160
  """Create an attachment to the given component.
128
161
 
@@ -331,7 +331,6 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
331
331
  model.set_value(lv_iter, TestList.Date, handle_test_date(payload["date"]))
332
332
  model.set_value(lv_iter, TestList.Institute, handle_test_date(payload["institution"]))
333
333
 
334
-
335
334
  dlg.hide()
336
335
  dlg.destroy()
337
336
 
@@ -391,7 +390,7 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
391
390
 
392
391
  box.pack_start(Gtk.Label(label="Select an Institute"), False, True, 0)
393
392
 
394
- combo = self.create_institute_combo()
393
+ combo = self.create_institute_combo(only_user=True)
395
394
  box.pack_start(combo, False, True, 5)
396
395
 
397
396
  btn = Gtk.CheckButton(label="Use as default for other tests missing institute ?")
@@ -441,11 +440,9 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
441
440
 
442
441
  model[lv_iter][TestList.Json] = data
443
442
 
444
-
445
443
  dlg.hide()
446
444
  dlg.destroy()
447
445
 
448
-
449
446
  def get_component_stages(self, SN):
450
447
  """Create a combo with the stages."""
451
448
  try:
@@ -468,11 +465,9 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
468
465
  self.write_message("Something went wrong with the stages\n")
469
466
  return [None, None]
470
467
 
471
- def add_test_data_to_view(self, data, ifile=None, folder=None):
468
+ def add_test_data_to_view(self, data, default_site=None, use_default=False, ifile=None, folder=None):
472
469
  """Add a test data to the tree view."""
473
470
  has_errors = False
474
- default_site = None
475
-
476
471
  errors, missing = check_data(data)
477
472
  if len(missing) > 0:
478
473
  self.write_message("Some keys are missing in the JSon file.\n")
@@ -533,16 +528,25 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
533
528
  ifile, data, len(attachments), attachments,
534
529
  len(comments), comments, len(defects), defects, color])
535
530
 
531
+ return default_site, use_default
532
+
536
533
  def add_tests_to_view(self, files):
537
534
  """Add the input fiels to the treeview."""
535
+ default_site = None
536
+ use_default = False
538
537
  for ifile in files:
539
538
  try:
540
539
  self.write_message("{}\n".format(Path(ifile).name))
541
540
  folder = Path(ifile).parent
542
541
 
543
- data = json.loads(open(ifile, 'r', encoding="UTF-8").read())
544
- self.add_test_data_to_view(data, ifile=ifile, folder=folder)
545
-
542
+ data = json.loads(open(ifile, "r", encoding="UTF-8").read())
543
+ default_site, use_default = self.add_test_data_to_view(
544
+ data,
545
+ default_site=default_site,
546
+ use_default=use_default,
547
+ ifile=ifile,
548
+ folder=folder,
549
+ )
546
550
 
547
551
  except Exception as E:
548
552
  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.12.0"
3
+ __version__ = "0.14.1"
4
4
 
5
5
 
6
6
  def dash_board():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: itkdb_gtk
3
- Version: 0.12.0
3
+ Version: 0.14.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
@@ -9,12 +9,12 @@ Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Operating System :: OS Independent
10
10
  Requires-Python: >=3.7
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: itkdb >=0.4.0
12
+ Requires-Dist: itkdb>=0.4.0
13
13
  Requires-Dist: numpy
14
14
  Requires-Dist: matplotlib
15
15
  Requires-Dist: openpyxl
16
16
  Requires-Dist: pyserial
17
- Requires-Dist: python-dateutil
17
+ Requires-Dist: python_dateutil
18
18
  Requires-Dist: requests
19
19
  Requires-Dist: PyGObject
20
20
 
@@ -4,24 +4,24 @@ 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=p1r1HqY0hP47Y0fRRweLPNR6rbPRebWS8d9y_vdj_lk,19586
7
+ itkdb_gtk/ITkDButils.py,sha256=KYnkUaVWD7pkC5BQvaI00TB5hRFp0NLzqKPliY0lCBE,20574
8
8
  itkdb_gtk/PanelVisualInspection.py,sha256=ktAcYbdLBS7Zbxq9XsxB_AWTgAfFLa42NFTEsxnBn98,20531
9
9
  itkdb_gtk/SensorUtils.py,sha256=fYWF9TeutAbore53dLWNlZnVn9P3OsKYcFLNGOs8cnI,15426
10
10
  itkdb_gtk/ShowAttachments.py,sha256=KExxPCdbcb04XS8JSUkg5xF1McvlB8e9btwctDCKNXU,8498
11
11
  itkdb_gtk/ShowComments.py,sha256=OiMTFLnhGbbKRj5x61D517BYHAt-qY5Y1lvR3EQz3c0,3151
12
12
  itkdb_gtk/ShowDefects.py,sha256=aVAHeaE5IztmAPEuHwhi06KWo_pi9xX2J1fTLhKyAPI,3530
13
13
  itkdb_gtk/UploadModuleIV.py,sha256=sqh52bSxANBwlmVWZlDqFXpqRGf0rV0QsjJWC-tY_qI,17792
14
- itkdb_gtk/UploadMultipleTests.py,sha256=TFEqcRd2ZZAVhK3P3Qn2vg81NouOCjkjqn9PhoHYhPM,24125
14
+ itkdb_gtk/UploadMultipleTests.py,sha256=Qh3AvjorE1vqo20bPwZD8x_66ZPrlSHrKHgAh3ZNtXs,24437
15
15
  itkdb_gtk/UploadTest.py,sha256=ukgJ5-IG12bqa1QIp3bXIV8hkdXCv5UDxh1lQswN_ko,16832
16
16
  itkdb_gtk/VisualInspection.py,sha256=i2i_9ttetMzGFRcBFm_ow7aziksTgvZzVLUxZhwiyBg,9850
17
17
  itkdb_gtk/WireBondGui.py,sha256=WFTLOw4l5JxSbvh4vZMxcF65fqlwvNw0fOyEru9ijqQ,39850
18
- itkdb_gtk/__init__.py,sha256=QfVXwkRQsVu9ek_4Ea5wQE8-2EW7TCaMBd8FxZToNI4,1156
18
+ itkdb_gtk/__init__.py,sha256=x6fOwYak3XMW6xIKvl0LyxT3qowyqkVG-a1DPhiaFZU,1156
19
19
  itkdb_gtk/dashBoard.py,sha256=DHoCxqhCtOvh7s3lMDJIxFVKEVCVvlnlteEyOjmUgIk,11432
20
20
  itkdb_gtk/dbGtkUtils.py,sha256=THW-IT5UJB1YluvUVIfpy6oIY2faSHChNKGTpY5qzag,30480
21
21
  itkdb_gtk/readGoogleSheet.py,sha256=Lzm_oPWwDqZZzKoBUgsp277F9-wCfr_BA0X4VD2Eolo,2673
22
22
  itkdb_gtk/untrash_component.py,sha256=VrN46-f-kF7voOxtoh7OL-bZSWAaIFb7-Xbx6_WT7K8,757
23
- itkdb_gtk-0.12.0.dist-info/METADATA,sha256=Xb7vlboPsvtqE5Wzh37Y_yMrlGhHkDhhw8CLbPKLu6o,3150
24
- itkdb_gtk-0.12.0.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
25
- itkdb_gtk-0.12.0.dist-info/entry_points.txt,sha256=pKg7qpsrZh1GUQ-n3aFsSxmTVm0h4Qdb_6nsNO_PsFw,437
26
- itkdb_gtk-0.12.0.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
27
- itkdb_gtk-0.12.0.dist-info/RECORD,,
23
+ itkdb_gtk-0.14.1.dist-info/METADATA,sha256=FRKQfeECJesaTwJ9_q8rfdsMUNn93Mhe02mzbGfpZAQ,3149
24
+ itkdb_gtk-0.14.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
25
+ itkdb_gtk-0.14.1.dist-info/entry_points.txt,sha256=pKg7qpsrZh1GUQ-n3aFsSxmTVm0h4Qdb_6nsNO_PsFw,437
26
+ itkdb_gtk-0.14.1.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
27
+ itkdb_gtk-0.14.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.5.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5