itkdb-gtk 0.10.10.dev2__py3-none-any.whl → 0.10.10.dev3__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
@@ -83,7 +83,7 @@ def get_db_date(timestamp=None):
83
83
  try:
84
84
  this_date = dateutil.parser.parse(timestamp)
85
85
  out = date2string(this_date)
86
-
86
+
87
87
  except (OverflowError, dateutil.parser.ParserError):
88
88
  out = ""
89
89
 
@@ -282,10 +282,7 @@ def upload_test(client, data, attachments=None, check_runNumber=False):
282
282
  # Check the given run_number. If already existing, give another one which
283
283
  # will try to be consecutive.
284
284
  if check_runNumber:
285
- def get_new_value(values):
286
- run_no = max([x for x in values.keys()])+1
287
- return run_no
288
-
285
+ # Get all the runNumbers in this test
289
286
  test_list = client.get("listTestRunsByComponent",
290
287
  json={
291
288
  "filterMap":{
@@ -295,20 +292,27 @@ def upload_test(client, data, attachments=None, check_runNumber=False):
295
292
  }
296
293
  }
297
294
  )
298
- values = {}
295
+ runN= {}
299
296
  for T in test_list:
300
- try:
301
- run_no = int(T["runNumber"])
302
- except ValueError:
303
- run_no = get_new_value(values)
297
+ runN[T["runNumber"]] = 1
304
298
 
305
- values[run_no] = 1
299
+ if data["runNumber"] in runN:
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"]))
302
+ try:
303
+ irun = int(data["runNumber"])
304
+ for i in range(irun+1, 100):
305
+ newRn = "{}".format(i+1)
306
+ if newRn not in runN:
307
+ data["runNumber"] = newRn
308
+ break
306
309
 
307
- try:
308
- if int(data["runNumber"]) in values.keys():
309
- data["runNumber"] = "{}".format(get_new_value(values))
310
- except ValueError:
311
- data["runNumber"] = "{}".format(get_new_value(values))
310
+ except ValueError:
311
+ for i in range(100):
312
+ newRn = "{}_{}".format(data["runNumber"], i+1)
313
+ if newRn not in runN:
314
+ data["runNumber"] = newRn
315
+ break
312
316
 
313
317
  # Try to upload the test
314
318
  try:
@@ -368,10 +372,10 @@ def set_test_run_parameter(session, test_run, parameter, value):
368
372
  """
369
373
  global db_response
370
374
  try:
371
- db_response = session.post("setTestRunParameter",
375
+ db_response = session.post("setTestRunParameter",
372
376
  json={"testRun": test_run, "code": parameter, "value": value})
373
377
  return None
374
-
378
+
375
379
  except Exception as E:
376
380
  return (str(E))
377
381
 
@@ -380,11 +384,11 @@ def create_test_run_comment(session, test_run, comments):
380
384
  global db_response
381
385
  if not isinstance(comments, Iterable):
382
386
  comments = (comments)
383
-
387
+
384
388
  try:
385
389
  db_response = session.post("createTestRunComment", json={"testRun": test_run, "comments": comments})
386
390
  return None
387
-
391
+
388
392
  except Exception as E:
389
393
  return (str(E))
390
394
 
@@ -672,12 +676,12 @@ def get_db_user(client):
672
676
 
673
677
  Args:
674
678
  client (itkdb.Client): The DB client.
675
-
679
+
676
680
  """
677
681
  global db_response
678
682
  if client is None:
679
683
  return None
680
-
684
+
681
685
  try:
682
686
  db_response = client.get("getUser", json={"userIdentity": client.user.identity})
683
687
  return db_response
@@ -511,7 +511,7 @@ class PanelVisualInspection(dbGtkUtils.ITkDBWindow):
511
511
  ipos = rc.find("The following details may help:")
512
512
  msg = rc[ipos:]
513
513
  dbGtkUtils.complain("Failed uploading test {}-{}".format(payload["component"], payload["testType"]), msg)
514
- self.write_message(msg)
514
+ self.write_message(msg+"\n")
515
515
 
516
516
  else:
517
517
  self.write_message("Upload {}-{} successfull\n".format(payload["component"], payload["testType"]))
@@ -525,15 +525,16 @@ class PanelVisualInspection(dbGtkUtils.ITkDBWindow):
525
525
  rc = ITkDButils.set_test_run_parameter(self.session,
526
526
  ITkDButils.uploaded_test_runs[0],
527
527
  "COMMENT", "Picture of PW carrier")
528
-
528
+
529
529
  rc = ITkDButils.set_test_run_parameter(self.session,
530
530
  ITkDButils.uploaded_test_runs[0],
531
531
  "LINK_TO_PICTURE", global_link)
532
532
  if rc:
533
533
  ipos = rc.find("The following details may help:")
534
534
  msg = rc[ipos:]
535
- dbGtkUtils.complain("Failed updating LINK_TO_PICTURE {}-{}".format(payload["component"], payload["testType"]), msg)
536
- self.write_message(msg)
535
+ dbGtkUtils.complain("Failed updating LINK_TO_PICTURE {}-{}".format(payload["component"],
536
+ payload["testType"]), msg)
537
+ self.write_message(msg+'\n')
537
538
 
538
539
  elif payload["testType"] == "VISUAL_INSPECTION_RECEPTION":
539
540
  rc = ITkDButils.create_test_run_comment(self.session,
@@ -542,8 +543,9 @@ class PanelVisualInspection(dbGtkUtils.ITkDBWindow):
542
543
  if rc:
543
544
  ipos = rc.find("The following details may help:")
544
545
  msg = rc[ipos:]
545
- dbGtkUtils.complain("Failed adding global link as comment: {}-{}".format(payload["component"], payload["testType"]), msg)
546
- self.write_message(msg)
546
+ dbGtkUtils.complain("Failed adding global link as comment: {}-{}".format(payload["component"],
547
+ payload["testType"]), msg)
548
+ self.write_message(msg+"\n")
547
549
 
548
550
 
549
551
  n_items += 1
itkdb_gtk/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """ itkdb-gtk python module
2
2
  """
3
- __version__ = "0.10.10.dev2"
3
+ __version__ = "0.10.10.dev3"
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.10.10.dev2
3
+ Version: 0.10.10.dev3
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,8 +4,8 @@ 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
- itkdb_gtk/ITkDButils.py,sha256=SCp9NFAFcNM_9m2PCEYdnn3SJDU7JhDAXFcBWkgR6es,19201
8
- itkdb_gtk/PanelVisualInspection.py,sha256=UdY40fre5EEIr4XHRmvbP0JkDP00HvNApX2CbImA_vw,20223
7
+ itkdb_gtk/ITkDButils.py,sha256=D33V0IXZeJxDK38ZduGBm_3yp23Xzr_OIeEfLMMy9vc,19482
8
+ itkdb_gtk/PanelVisualInspection.py,sha256=M_qUpH99TqeJD1OA3iQYYT4ngMrVxNDHvAuAqboe-LA,20406
9
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
@@ -16,14 +16,14 @@ itkdb_gtk/UploadMultipleTests.py,sha256=U94u9WJLeHPgBKT2lPOCxTaXf1Rv19mb5VzLq6bY
16
16
  itkdb_gtk/UploadPetalInformation.py,sha256=N0OgGcbjB6uagUUJVwSNhuNPnGHh8PtqjOm2BncrYxI,25874
17
17
  itkdb_gtk/UploadTest.py,sha256=g2NohkkRNJXsaODncyR6hnYpawURA6VBSqFe1Zg-h2A,16641
18
18
  itkdb_gtk/WireBondGui.py,sha256=lG4eH8CNEf15yiEZ7l7bDayw3zOaKGKx2JGB-IcEBa0,33601
19
- itkdb_gtk/__init__.py,sha256=i12_VChfdfkF1EGhwYDYxWBggWEvdC_RaQ0zKFRdm0o,1292
19
+ itkdb_gtk/__init__.py,sha256=UbaWtaANOBIU8grb6iNMZraWGnFIRO7qCkXFeuHJyl0,1292
20
20
  itkdb_gtk/dashBoard.py,sha256=FOmp0hwToN5Lo3cHf1a5RZv6fP9EsIs462PJErtz7Pw,9010
21
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.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,,
25
+ itkdb_gtk-0.10.10.dev3.dist-info/METADATA,sha256=grLxhumKNNPWX7Ve5gp4G_SMd4RqGPdGtwosR4DIOX8,3156
26
+ itkdb_gtk-0.10.10.dev3.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
27
+ itkdb_gtk-0.10.10.dev3.dist-info/entry_points.txt,sha256=Xf_DDU3QlT2zogRFMOJdO4BdVuAKyAwmb2jHZ5KbBxE,501
28
+ itkdb_gtk-0.10.10.dev3.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
29
+ itkdb_gtk-0.10.10.dev3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (74.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5