itkdb-gtk 0.12.0__tar.gz → 0.14.1.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 (39) hide show
  1. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/PKG-INFO +1 -1
  2. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/ITkDButils.py +35 -2
  3. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/UploadMultipleTests.py +14 -10
  4. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/__init__.py +1 -1
  5. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk.egg-info/PKG-INFO +1 -1
  6. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/pyproject.toml +1 -1
  7. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/test/testBatch.py +17 -6
  8. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/README.md +0 -0
  9. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/CreateShipments.py +0 -0
  10. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/GetShipments.py +0 -0
  11. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/GlueWeight.py +0 -0
  12. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/ITkDB.desktop +0 -0
  13. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/ITkDB.svg +0 -0
  14. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/ITkDBlogin.py +0 -0
  15. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/PanelVisualInspection.py +0 -0
  16. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/SensorUtils.py +0 -0
  17. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/ShowAttachments.py +0 -0
  18. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/ShowComments.py +0 -0
  19. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/ShowDefects.py +0 -0
  20. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/UploadModuleIV.py +0 -0
  21. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/UploadTest.py +0 -0
  22. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/VisualInspection.py +0 -0
  23. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/WireBondGui.py +0 -0
  24. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/dashBoard.py +0 -0
  25. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/dbGtkUtils.py +0 -0
  26. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/readGoogleSheet.py +0 -0
  27. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk/untrash_component.py +0 -0
  28. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk.egg-info/SOURCES.txt +0 -0
  29. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk.egg-info/dependency_links.txt +0 -0
  30. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk.egg-info/entry_points.txt +0 -0
  31. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk.egg-info/requires.txt +0 -0
  32. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/itkdb_gtk.egg-info/top_level.txt +0 -0
  33. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/setup.cfg +0 -0
  34. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/test/testAnimated.py +0 -0
  35. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/test/testComponent.py +0 -0
  36. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/test/testRange.py +0 -0
  37. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/test/testThread.py +0 -0
  38. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/test/test_attachment.py +0 -0
  39. {itkdb_gtk-0.12.0 → itkdb_gtk-0.14.1.dev1}/test/test_holes.py +0 -0
@@ -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.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
@@ -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_defaule=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))
@@ -1,6 +1,6 @@
1
1
  """ itkdb-gtk python module
2
2
  """
3
- __version__ = "0.12.0"
3
+ __version__ = "0.14.1.dev1"
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.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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "itkdb_gtk"
7
- version = "0.12.0"
7
+ version = "0.14.1.dev1"
8
8
  authors = [
9
9
  { name="Carlos Lacasta", email="carlos.lacasta@cern.ch" },
10
10
  ]
@@ -34,13 +34,15 @@ def get_all_Petals(session):
34
34
  def list_petal_core_batches(session):
35
35
  """Get list of Petal core batches"""
36
36
  payload = {
37
+ "filterMap": {
37
38
  "project": "S",
38
- "batchType": ["PETAL_CORE_PROTO", "PETAL_CORE_PREPROD", "PETAL_CORE_PROD"],
39
+ "batchType": ["PETAL_CORE_BATCH_TYPE"],
40
+ }
39
41
  }
40
42
  batch_list = session.get("listBatches", json=payload)
41
43
  rc = {}
42
44
  for B in batch_list:
43
- rc[B["code"] ]= B["id"]
45
+ rc[B["number"] ]= B["id"]
44
46
 
45
47
  return rc
46
48
 
@@ -50,7 +52,7 @@ def create_petal_core_batchType(session):
50
52
  out = session.post(
51
53
  "createBatchType",
52
54
  json={
53
- "code": "PETAL_CORE",
55
+ "code": "PETAL_CORE_BATCH_TYPE",
54
56
  "name": "Petal Core",
55
57
  "state": "active",
56
58
  "project": "S",
@@ -60,7 +62,7 @@ def create_petal_core_batchType(session):
60
62
  "createBatch",
61
63
  json={
62
64
  "project": "S",
63
- "batchType": "PETAL_CORE",
65
+ "batchType": "PETAL_CORE_BATCH_TYPE",
64
66
  "number": "PETAL_CORE_PROTO",
65
67
  "ownerInstituteList": ["IFIC", "AVS", "DESYHH"],
66
68
  },
@@ -69,7 +71,7 @@ def create_petal_core_batchType(session):
69
71
  "createBatch",
70
72
  json={
71
73
  "project": "S",
72
- "batchType": "PETAL_CORE",
74
+ "batchType": "PETAL_CORE_BATCH_TYPE",
73
75
  "number": "PETAL_CORE_PREPROD",
74
76
  "ownerInstituteList": ["IFIC", "AVS", "DESYHH"],
75
77
  },
@@ -78,7 +80,7 @@ def create_petal_core_batchType(session):
78
80
  "createBatch",
79
81
  json={
80
82
  "project": "S",
81
- "batchType": "PETAL_CORE",
83
+ "batchType": "PETAL_CORE_BATCH_TYPE",
82
84
  "number": "PETAL_CORE_PROD",
83
85
  "ownerInstituteList": ["IFIC", "AVS", "DESYHH"],
84
86
  },
@@ -86,6 +88,9 @@ def create_petal_core_batchType(session):
86
88
 
87
89
 
88
90
  def main(session):
91
+ """Create batchers."""
92
+ #create_petal_core_batchType(session)
93
+
89
94
  batch_list = list_petal_core_batches(session)
90
95
 
91
96
  # # create the batches
@@ -112,6 +117,10 @@ def main(session):
112
117
 
113
118
  print("{} - {}".format(aliasID, batch_code))
114
119
  rc = session.post("addBatchComponent", json={"id":batch_list[batch_code], "component": petal_core["id"]})
120
+ if rc is None:
121
+ pass
122
+ else:
123
+ pass
115
124
 
116
125
 
117
126
  if __name__ == "__main__":
@@ -124,3 +133,5 @@ if __name__ == "__main__":
124
133
 
125
134
  except Exception as E:
126
135
  print(E)
136
+
137
+ dlg.die()
File without changes
File without changes