itkdb-gtk 0.10.10.dev2__py3-none-any.whl → 0.10.10.dev4__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:
@@ -346,7 +350,8 @@ def upload_test(client, data, attachments=None, check_runNumber=False):
346
350
  data=data,
347
351
  files=attachment)
348
352
  try:
349
- attachment_urls[path.name] = db_response['url']
353
+ url = db_response['url'].replace("https://eosatlas.cern.ch","https://cernbox.cern.ch/files/spaces")
354
+ attachment_urls[path.name] = url
350
355
 
351
356
  except KeyError:
352
357
  pass
@@ -368,10 +373,10 @@ def set_test_run_parameter(session, test_run, parameter, value):
368
373
  """
369
374
  global db_response
370
375
  try:
371
- db_response = session.post("setTestRunParameter",
376
+ db_response = session.post("setTestRunParameter",
372
377
  json={"testRun": test_run, "code": parameter, "value": value})
373
378
  return None
374
-
379
+
375
380
  except Exception as E:
376
381
  return (str(E))
377
382
 
@@ -380,11 +385,11 @@ def create_test_run_comment(session, test_run, comments):
380
385
  global db_response
381
386
  if not isinstance(comments, Iterable):
382
387
  comments = (comments)
383
-
388
+
384
389
  try:
385
390
  db_response = session.post("createTestRunComment", json={"testRun": test_run, "comments": comments})
386
391
  return None
387
-
392
+
388
393
  except Exception as E:
389
394
  return (str(E))
390
395
 
@@ -672,12 +677,12 @@ def get_db_user(client):
672
677
 
673
678
  Args:
674
679
  client (itkdb.Client): The DB client.
675
-
680
+
676
681
  """
677
682
  global db_response
678
683
  if client is None:
679
684
  return None
680
-
685
+
681
686
  try:
682
687
  db_response = client.get("getUser", json={"userIdentity": client.user.identity})
683
688
  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,11 @@ 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")
549
+ else:
550
+ self.write_message("Image: {}\n".format(global_link))
547
551
 
548
552
 
549
553
  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.dev4"
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.dev4
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=WYjE_DOnFJdxhhQ5ylVTupIOjrp2r83jQALa0Gc2xZg,19587
8
+ itkdb_gtk/PanelVisualInspection.py,sha256=EO0bsPnzD7aT2iBs2SShOAfbixvYcDrByLpjVOEk4MM,20510
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=Hbo4BBh0ejzMgHCQMXiGWDTJxvOS_S3Atfwoh8Xhbgc,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.dev4.dist-info/METADATA,sha256=ubHgTwSfYPsRws4PJNFQDlIIZ_vMygovaPpxSVuC0w4,3156
26
+ itkdb_gtk-0.10.10.dev4.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
27
+ itkdb_gtk-0.10.10.dev4.dist-info/entry_points.txt,sha256=Xf_DDU3QlT2zogRFMOJdO4BdVuAKyAwmb2jHZ5KbBxE,501
28
+ itkdb_gtk-0.10.10.dev4.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
29
+ itkdb_gtk-0.10.10.dev4.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