itkdb-gtk 0.18.0.dev1__py3-none-any.whl → 0.18.0.dev2__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
@@ -1,5 +1,6 @@
1
1
  """Utilities for the inteaction with the ITkDB."""
2
2
  import mimetypes
3
+ import traceback
3
4
  from collections.abc import Iterable
4
5
  from datetime import datetime
5
6
  from pathlib import Path
@@ -7,6 +8,8 @@ import getpass
7
8
 
8
9
  import dateutil.parser
9
10
  import itkdb
11
+ import magic
12
+ import locale
10
13
 
11
14
  # The response of the DB
12
15
  db_response = ""
@@ -377,13 +380,18 @@ def upload_test(client, data, attachments=None, check_runNumber=False):
377
380
  if newRn not in runN:
378
381
  data["runNumber"] = newRn
379
382
  break
380
-
383
+
381
384
  # Try to upload the test
382
385
  try:
383
386
  db_response = client.post("uploadTestRunResults", json=data)
384
387
  testRun = db_response["testRun"]["id"]
385
388
  uploaded_test_runs.append(testRun)
386
389
 
390
+ except Exception as e:
391
+ msg = "Could not upload the test:\n{}".format(str(e))
392
+ return msg
393
+
394
+ try:
387
395
  # Handle attachments.
388
396
  attachment_urls = {}
389
397
  if attachments is not None:
@@ -402,12 +410,12 @@ def upload_test(client, data, attachments=None, check_runNumber=False):
402
410
  print("File {} does not exist".format(path))
403
411
  continue
404
412
 
405
- data["url"] = path.as_uri()
406
- filetype = mimetypes.guess_type(path.name)
407
- attachment = {'data': (path.as_posix(), open(path.as_posix(), 'rb'), filetype[0])}
413
+ data["url"] = str(path.as_uri())
414
+ filetype = itkdb.utils.get_mimetype(path.as_posix(), None)
415
+ attachment = {'data': (path.as_posix(), open(path.as_posix(), 'rb'), filetype)}
408
416
  else:
409
417
  data["url"] = att.url
410
- filetype = mimetypes.guess_type(att.url)
418
+ filetype = itkdb.utils.get_mimetype(att.url, None)
411
419
  attachment = {'data':(att.url, None, "text/x-uri") }
412
420
 
413
421
  db_response = client.post('createTestRunAttachment',
@@ -424,7 +432,9 @@ def upload_test(client, data, attachments=None, check_runNumber=False):
424
432
  return None
425
433
 
426
434
  except Exception as e:
427
- return (str(e))
435
+ print(traceback.format_exc())
436
+ return "Could not upload attachment:\n{}".format(str(e))
437
+
428
438
 
429
439
  def set_test_run_parameter(session, test_run, parameter, value):
430
440
  """Modify testRun Parameter
@@ -687,8 +687,11 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
687
687
  rc = ITkDButils.upload_test(self.session, payload, values[TestList.Attachments], check_runNumber=True)
688
688
  if rc:
689
689
  ipos = rc.find("The following details may help:")
690
- msg = rc[ipos:]
691
- dbGtkUtils.complain("Failed uploading test {}-{}".format(payload["component"], payload["testType"]))
690
+ if ipos>=0:
691
+ msg = rc[ipos:]
692
+ else:
693
+ msg = rc
694
+ dbGtkUtils.complain("Failed uploading test {}-{}\n".format(payload["component"], payload["testType"]), msg)
692
695
  self.write_message("Failed uploading test {}-{}\n{}\n".format(payload["component"], payload["testType"], msg))
693
696
  nbad += 1
694
697
 
@@ -702,7 +705,7 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
702
705
  model.remove(past_iter)
703
706
 
704
707
  if nbad>0:
705
- dbGtkUtils.complain("Failed to upload all tests", "{} test had errors.\nThey are left in the ListView.")
708
+ dbGtkUtils.complain("Failed to upload some tests", "{}/{} tests had errors.\nThey are left in the ListView.".format(nbad, ngood))
706
709
  else:
707
710
  dbGtkUtils.complain("All {} tests uploaded succesfully".format(ngood))
708
711
 
itkdb_gtk/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """ itkdb-gtk python module
2
2
  """
3
- __version__ = "0.18.0.dev1"
3
+ __version__ = "0.18.0.dev2"
4
4
 
5
5
 
6
6
  def dash_board():
@@ -55,3 +55,8 @@ def visualInspection():
55
55
  """Visual inspection of Modules/Sensors."""
56
56
  from .VisualInspection import main
57
57
  main()
58
+
59
+ def findDBComponent():
60
+ """Find object from QR or bar code"""
61
+ from .findComponent import main
62
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: itkdb_gtk
3
- Version: 0.18.0.dev1
3
+ Version: 0.18.0.dev2
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,25 +4,25 @@ 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=AUYbSexIMsCsAKRoKOAVn0jM31e5JQvioEdxtgBztvg,21454
7
+ itkdb_gtk/ITkDButils.py,sha256=SYGtE7D0xOEo5J9rWYfpzQydBpRR1zXPKToJvt_aTEk,21756
8
8
  itkdb_gtk/PanelVisualInspection.py,sha256=96_JMfJXfaqxN4vq2Y9rjdRY7pikuobOTGmrSOxHwV8,20511
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=ZT5aStkBL62_VUj41dGKN0eN95cGizYS_CLOEEFRvuo,25186
14
+ itkdb_gtk/UploadMultipleTests.py,sha256=tFXGyeIC-c1Gh_Fyjr_AddDnKReGMrMphdotRzIsR-s,25301
15
15
  itkdb_gtk/UploadTest.py,sha256=ukgJ5-IG12bqa1QIp3bXIV8hkdXCv5UDxh1lQswN_ko,16832
16
16
  itkdb_gtk/VisualInspection.py,sha256=akKPWGbE9DxqTM1csCbov9SqnlTvW_RRKtpqWV64zG4,9841
17
17
  itkdb_gtk/WireBondGui.py,sha256=WFTLOw4l5JxSbvh4vZMxcF65fqlwvNw0fOyEru9ijqQ,39850
18
- itkdb_gtk/__init__.py,sha256=SWwbFt4upvQvXxPdUjwq1nSAmLT7BCmSnEK8hcDNODU,1161
18
+ itkdb_gtk/__init__.py,sha256=rY6h1FOEbkt3srqgeHLzgndlOInsG9VG-8flGBuT0kg,1274
19
19
  itkdb_gtk/dashBoard.py,sha256=1kNSJn-iJ-ME6Nhtz-TfjFQsdKIlBooExrD8U_LgyEA,12293
20
20
  itkdb_gtk/dbGtkUtils.py,sha256=THW-IT5UJB1YluvUVIfpy6oIY2faSHChNKGTpY5qzag,30480
21
21
  itkdb_gtk/findComponent.py,sha256=6ZKh9Uz1LdvN8AchSK-LV3qRQmzihBGiTajDJrrBWac,4078
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.18.0.dev1.dist-info/METADATA,sha256=DxXRq0I9b5nqgmnafEvx6Zm0l409dD5GaRBc8OHZeFo,3154
25
- itkdb_gtk-0.18.0.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
- itkdb_gtk-0.18.0.dev1.dist-info/entry_points.txt,sha256=pKg7qpsrZh1GUQ-n3aFsSxmTVm0h4Qdb_6nsNO_PsFw,437
27
- itkdb_gtk-0.18.0.dev1.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
28
- itkdb_gtk-0.18.0.dev1.dist-info/RECORD,,
24
+ itkdb_gtk-0.18.0.dev2.dist-info/METADATA,sha256=emf2dkerrJTiKUinpo_d2EsdbS94wY3mLeALecjtCRg,3154
25
+ itkdb_gtk-0.18.0.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
+ itkdb_gtk-0.18.0.dev2.dist-info/entry_points.txt,sha256=vN0_mqIT6NwsnHirFsf3JHu-wq8CSHXE1IlhZzB5sbU,481
27
+ itkdb_gtk-0.18.0.dev2.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
28
+ itkdb_gtk-0.18.0.dev2.dist-info/RECORD,,
@@ -1,5 +1,6 @@
1
1
  [gui_scripts]
2
2
  createShipments = itkdb_gtk:createShipments
3
+ findDBComponent = itkdb_gtk:findDBComponent
3
4
  getShipments = itkdb_gtk:getShipments
4
5
  glueWeight = itkdb_gtk:glueWeight
5
6
  itkdb_dashBoard = itkdb_gtk:dash_board