itkdb-gtk 0.10.9.dev3__py3-none-any.whl → 0.10.10.dev1__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/CreateShipments.py +22 -21
- itkdb_gtk/GetShipments.py +37 -66
- itkdb_gtk/GlueWeight.py +2 -2
- itkdb_gtk/ITkDBlogin.py +6 -2
- itkdb_gtk/ITkDButils.py +133 -19
- itkdb_gtk/PanelVisualInspection.py +250 -70
- itkdb_gtk/PetalReceptionTests.py +14 -7
- itkdb_gtk/SensorUtils.py +16 -14
- itkdb_gtk/ShowAttachments.py +3 -1
- itkdb_gtk/UploadModuleIV.py +8 -8
- itkdb_gtk/UploadMultipleTests.py +53 -50
- itkdb_gtk/UploadPetalInformation.py +49 -11
- itkdb_gtk/UploadTest.py +8 -8
- itkdb_gtk/WireBondGui.py +232 -36
- itkdb_gtk/__init__.py +2 -2
- itkdb_gtk/dashBoard.py +15 -14
- itkdb_gtk/dbGtkUtils.py +72 -23
- itkdb_gtk/readAVSdata.py +5 -5
- {itkdb_gtk-0.10.9.dev3.dist-info → itkdb_gtk-0.10.10.dev1.dist-info}/METADATA +1 -1
- itkdb_gtk-0.10.10.dev1.dist-info/RECORD +29 -0
- {itkdb_gtk-0.10.9.dev3.dist-info → itkdb_gtk-0.10.10.dev1.dist-info}/WHEEL +1 -1
- itkdb_gtk-0.10.9.dev3.dist-info/RECORD +0 -29
- {itkdb_gtk-0.10.9.dev3.dist-info → itkdb_gtk-0.10.10.dev1.dist-info}/entry_points.txt +0 -0
- {itkdb_gtk-0.10.9.dev3.dist-info → itkdb_gtk-0.10.10.dev1.dist-info}/top_level.txt +0 -0
itkdb_gtk/UploadModuleIV.py
CHANGED
|
@@ -16,7 +16,6 @@ import json
|
|
|
16
16
|
import tempfile
|
|
17
17
|
import copy
|
|
18
18
|
from pathlib import Path
|
|
19
|
-
import shutil
|
|
20
19
|
|
|
21
20
|
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas
|
|
22
21
|
from matplotlib.backends.backend_gtk3 import NavigationToolbar2GTK3 as NavigationToolbar
|
|
@@ -56,11 +55,12 @@ def remove_files(W, flist):
|
|
|
56
55
|
class IVwindow(dbGtkUtils.ITkDBWindow):
|
|
57
56
|
"""GUI for IV file handling."""
|
|
58
57
|
|
|
59
|
-
def __init__(self, session, title="IV window", options=None,
|
|
58
|
+
def __init__(self, session, title="IV window", options=None, help_link=None):
|
|
60
59
|
"""Initialization."""
|
|
61
|
-
super().__init__(
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
super().__init__(session=session, title=title,
|
|
61
|
+
show_search=None, gtk_runs=gtk_runs,
|
|
62
|
+
help_link=help_link
|
|
63
|
+
)
|
|
64
64
|
self.mdata = {}
|
|
65
65
|
self.mod_type = {}
|
|
66
66
|
self.mod_SN = {}
|
|
@@ -179,7 +179,7 @@ class IVwindow(dbGtkUtils.ITkDBWindow):
|
|
|
179
179
|
js_out.write(json.dumps(test, indent=3, cls=dbGtkUtils.MyEncoder))
|
|
180
180
|
js_out.close()
|
|
181
181
|
|
|
182
|
-
attachment = ITkDButils.Attachment(data_out.name, "resultsFile", fnam)
|
|
182
|
+
attachment = ITkDButils.Attachment(path=data_out.name, title="resultsFile", desc=fnam)
|
|
183
183
|
uploadW = UploadTest.UploadTest(self.session, js_out.name, attachment)
|
|
184
184
|
uploadW.connect("destroy", remove_files, [data_out.name, js_out.name])
|
|
185
185
|
|
|
@@ -247,7 +247,7 @@ class IVwindow(dbGtkUtils.ITkDBWindow):
|
|
|
247
247
|
rc = fc.run()
|
|
248
248
|
if rc == Gtk.ResponseType.OK:
|
|
249
249
|
SensorUtils.save_sensor_data(fc.get_filename(), mdata)
|
|
250
|
-
|
|
250
|
+
|
|
251
251
|
fc.hide()
|
|
252
252
|
fc.destroy()
|
|
253
253
|
|
|
@@ -256,7 +256,7 @@ class IVwindow(dbGtkUtils.ITkDBWindow):
|
|
|
256
256
|
|
|
257
257
|
if do_both.get_active():
|
|
258
258
|
self.upload_test(self.mdata["single"], self.mod_type["single"])
|
|
259
|
-
|
|
259
|
+
|
|
260
260
|
dlg.destroy()
|
|
261
261
|
|
|
262
262
|
def on_refresh(self, *args):
|
itkdb_gtk/UploadMultipleTests.py
CHANGED
|
@@ -11,7 +11,6 @@ try:
|
|
|
11
11
|
import itkdb_gtk
|
|
12
12
|
|
|
13
13
|
except ImportError:
|
|
14
|
-
from pathlib import Path
|
|
15
14
|
cwd = Path(__file__).parent.parent
|
|
16
15
|
sys.path.append(cwd.as_posix())
|
|
17
16
|
|
|
@@ -103,15 +102,17 @@ def check_data(data):
|
|
|
103
102
|
class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
104
103
|
"""Collects information to upload a test and its attachments."""
|
|
105
104
|
|
|
106
|
-
def __init__(self, session,
|
|
105
|
+
def __init__(self, session, help_link=None):
|
|
107
106
|
"""Initialization.
|
|
108
107
|
|
|
109
108
|
Args:
|
|
110
109
|
session: ITkDB session
|
|
111
110
|
|
|
112
111
|
"""
|
|
113
|
-
super().__init__(session=session, title="Upload Tests", gtk_runs=gtk_runs,
|
|
112
|
+
super().__init__(session=session, title="Upload Tests", gtk_runs=gtk_runs, help_link=help_link)
|
|
114
113
|
self.tests = []
|
|
114
|
+
self.data = None
|
|
115
|
+
self.tree = None
|
|
115
116
|
|
|
116
117
|
self.init_window()
|
|
117
118
|
|
|
@@ -224,12 +225,12 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
224
225
|
# double click shows attachments
|
|
225
226
|
if event.button == 1 and event.type == Gdk.EventType.DOUBLE_BUTTON_PRESS:
|
|
226
227
|
select = self.tree.get_selection()
|
|
227
|
-
model,
|
|
228
|
-
if not
|
|
228
|
+
model, lv_iter = select.get_selected()
|
|
229
|
+
if not lv_iter:
|
|
229
230
|
return
|
|
230
231
|
|
|
231
|
-
self.on_show_json(None, (model,
|
|
232
|
-
# self.on_show_attachments(None, (model,
|
|
232
|
+
self.on_show_json(None, (model, lv_iter, model[lv_iter]))
|
|
233
|
+
# self.on_show_attachments(None, (model, lv_iter, model[lv_iter]))
|
|
233
234
|
return
|
|
234
235
|
|
|
235
236
|
if event.button != 3:
|
|
@@ -237,44 +238,44 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
237
238
|
|
|
238
239
|
# Create popup menu
|
|
239
240
|
select = self.tree.get_selection()
|
|
240
|
-
model,
|
|
241
|
+
model, lv_iter = select.get_selected()
|
|
241
242
|
values = None
|
|
242
|
-
if
|
|
243
|
-
values = model[
|
|
243
|
+
if lv_iter:
|
|
244
|
+
values = model[lv_iter]
|
|
244
245
|
|
|
245
|
-
if not
|
|
246
|
+
if not lv_iter:
|
|
246
247
|
P = tree.get_path_at_pos(event.x, event.y)
|
|
247
248
|
if P:
|
|
248
249
|
print(P[0].to_string())
|
|
249
|
-
|
|
250
|
-
values = model[
|
|
250
|
+
lv_iter = model.get_iter(P[0])
|
|
251
|
+
values = model[lv_iter]
|
|
251
252
|
|
|
252
253
|
if not values:
|
|
253
254
|
return
|
|
254
255
|
|
|
255
256
|
menu = Gtk.Menu()
|
|
256
257
|
item_show = Gtk.MenuItem(label="Show JSOn")
|
|
257
|
-
item_show.connect("activate", self.on_show_json, (model,
|
|
258
|
+
item_show.connect("activate", self.on_show_json, (model, lv_iter, values))
|
|
258
259
|
menu.append(item_show)
|
|
259
260
|
|
|
260
261
|
item_set_stage = Gtk.MenuItem(label="Set Stage")
|
|
261
|
-
item_set_stage.connect("activate", self.on_set_stage, (model,
|
|
262
|
+
item_set_stage.connect("activate", self.on_set_stage, (model, lv_iter, values))
|
|
262
263
|
menu.append(item_set_stage)
|
|
263
264
|
|
|
264
265
|
item_show_att = Gtk.MenuItem(label="Edit Attachments")
|
|
265
|
-
item_show_att.connect("activate", self.on_show_attachments, (model,
|
|
266
|
+
item_show_att.connect("activate", self.on_show_attachments, (model, lv_iter, values))
|
|
266
267
|
menu.append(item_show_att)
|
|
267
268
|
|
|
268
269
|
item_show_com = Gtk.MenuItem(label="Edit Comments")
|
|
269
|
-
item_show_com.connect("activate", self.on_show_comments, (model,
|
|
270
|
+
item_show_com.connect("activate", self.on_show_comments, (model, lv_iter, values))
|
|
270
271
|
menu.append(item_show_com)
|
|
271
272
|
|
|
272
273
|
item_show_def = Gtk.MenuItem(label="Edit Defects")
|
|
273
|
-
item_show_def.connect("activate", self.on_show_defects, (model,
|
|
274
|
+
item_show_def.connect("activate", self.on_show_defects, (model, lv_iter, values))
|
|
274
275
|
menu.append(item_show_def)
|
|
275
276
|
|
|
276
277
|
item_del = Gtk.MenuItem(label="Delete")
|
|
277
|
-
item_del.connect("activate", self.on_delete_tests, (model,
|
|
278
|
+
item_del.connect("activate", self.on_delete_tests, (model, lv_iter, values))
|
|
278
279
|
menu.append(item_del)
|
|
279
280
|
menu.show_all()
|
|
280
281
|
|
|
@@ -282,17 +283,17 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
282
283
|
|
|
283
284
|
def on_show_json(self, item, data):
|
|
284
285
|
"""Test JSon."""
|
|
285
|
-
model,
|
|
286
|
+
model, lv_iter, val = data
|
|
286
287
|
payload = val[TestList.Json]
|
|
287
288
|
value, dlg = create_json_data_editor(payload)
|
|
288
289
|
rc = dlg.run()
|
|
289
290
|
if rc == Gtk.ResponseType.OK:
|
|
290
291
|
payload = value.values
|
|
291
|
-
model.set_value(
|
|
292
|
-
model.set_value(
|
|
293
|
-
model.set_value(
|
|
294
|
-
model.set_value(
|
|
295
|
-
model.set_value(
|
|
292
|
+
model.set_value(lv_iter, TestList.Json, payload)
|
|
293
|
+
model.set_value(lv_iter, TestList.SN, payload["component"])
|
|
294
|
+
model.set_value(lv_iter, TestList.RunNumber, payload["runNumber"])
|
|
295
|
+
model.set_value(lv_iter, TestList.Date, handle_test_date(payload["date"]))
|
|
296
|
+
model.set_value(lv_iter, TestList.Institute, handle_test_date(payload["institution"]))
|
|
296
297
|
|
|
297
298
|
|
|
298
299
|
dlg.hide()
|
|
@@ -300,48 +301,48 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
300
301
|
|
|
301
302
|
def on_show_attachments(self, item, data):
|
|
302
303
|
"""Show the attachmetns."""
|
|
303
|
-
model,
|
|
304
|
+
model, lv_iter, val = data
|
|
304
305
|
|
|
305
306
|
SA = ShowAttachments("Test Attachments", self.session, val[TestList.Attachments], parent=self)
|
|
306
307
|
response = SA.run()
|
|
307
308
|
if response == Gtk.ResponseType.OK:
|
|
308
|
-
model.set_value(
|
|
309
|
-
model.set_value(
|
|
309
|
+
model.set_value(lv_iter, TestList.Attachments, SA.attachments)
|
|
310
|
+
model.set_value(lv_iter, TestList.Nattch, len(SA.attachments))
|
|
310
311
|
|
|
311
312
|
SA.hide()
|
|
312
313
|
SA.destroy()
|
|
313
314
|
|
|
314
315
|
def on_show_comments(self, item, data):
|
|
315
316
|
"""Show comments"""
|
|
316
|
-
model,
|
|
317
|
+
model, lv_iter, val = data
|
|
317
318
|
SC = ShowComments("Test Comments", val[TestList.Comments], self)
|
|
318
319
|
rc = SC.run()
|
|
319
320
|
if rc == Gtk.ResponseType.OK:
|
|
320
|
-
model.set_value(
|
|
321
|
-
model.set_value(
|
|
321
|
+
model.set_value(lv_iter, TestList.Comments, SC.comments)
|
|
322
|
+
model.set_value(lv_iter, TestList.Ncomm, len(SC.comments))
|
|
322
323
|
|
|
323
324
|
SC.hide()
|
|
324
325
|
SC.destroy()
|
|
325
326
|
|
|
326
327
|
def on_show_defects(self, item, data):
|
|
327
328
|
"""Show comments"""
|
|
328
|
-
model,
|
|
329
|
+
model, lv_iter, val = data
|
|
329
330
|
SD = ShowDefects("Test Defects", val[TestList.Defects], self)
|
|
330
331
|
rc = SD.run()
|
|
331
332
|
if rc == Gtk.ResponseType.OK:
|
|
332
|
-
model.set_value(
|
|
333
|
-
model.set_value(
|
|
333
|
+
model.set_value(lv_iter, TestList.Defects, SD.defects)
|
|
334
|
+
model.set_value(lv_iter, TestList.Ndef, len(SD.defects))
|
|
334
335
|
|
|
335
336
|
SD.hide()
|
|
336
337
|
SD.destroy()
|
|
337
338
|
|
|
338
339
|
def on_delete_tests(self, item, data):
|
|
339
340
|
"""Test edit."""
|
|
340
|
-
model,
|
|
341
|
+
model, lv_iter, val = data
|
|
341
342
|
rc = dbGtkUtils.ask_for_confirmation("Remove this test?",
|
|
342
343
|
"{} - {}".format(val[TestList.SN], val[TestList.TestType]))
|
|
343
344
|
if rc:
|
|
344
|
-
model.remove(
|
|
345
|
+
model.remove(lv_iter)
|
|
345
346
|
|
|
346
347
|
def get_test_institute(self):
|
|
347
348
|
"""Select an institue."""
|
|
@@ -373,7 +374,7 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
373
374
|
|
|
374
375
|
def on_set_stage(self, item, data):
|
|
375
376
|
"""Set the test stage."""
|
|
376
|
-
model,
|
|
377
|
+
model, lv_iter, val = data
|
|
377
378
|
SN = val[TestList.SN]
|
|
378
379
|
combo, currentStage = self.get_component_stages(SN)
|
|
379
380
|
|
|
@@ -392,9 +393,9 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
392
393
|
rc = dlg.run()
|
|
393
394
|
if rc == Gtk.ResponseType.OK:
|
|
394
395
|
new_stage = combo.get_active_text()
|
|
395
|
-
model[
|
|
396
|
-
data = model[
|
|
397
|
-
changed = (new_stage != model[
|
|
396
|
+
model[lv_iter][TestList.Stage] = new_stage
|
|
397
|
+
data = model[lv_iter][TestList.Json]
|
|
398
|
+
changed = (new_stage != model[lv_iter][TestList.currentStage])
|
|
398
399
|
data["isRetroactive"] = changed
|
|
399
400
|
if changed:
|
|
400
401
|
data["stage"] = new_stage
|
|
@@ -402,7 +403,7 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
402
403
|
if "stage" in data:
|
|
403
404
|
del data["stage"]
|
|
404
405
|
|
|
405
|
-
model[
|
|
406
|
+
model[lv_iter][TestList.Json] = data
|
|
406
407
|
|
|
407
408
|
|
|
408
409
|
dlg.hide()
|
|
@@ -437,9 +438,9 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
437
438
|
for ifile in files:
|
|
438
439
|
try:
|
|
439
440
|
has_errors = False
|
|
440
|
-
data = json.loads(open(ifile).read())
|
|
441
|
+
data = json.loads(open(ifile, 'r', encoding="UTF-8").read())
|
|
441
442
|
errors, missing = check_data(data)
|
|
442
|
-
if len(missing):
|
|
443
|
+
if len(missing) > 0:
|
|
443
444
|
self.write_message("{}\n".format(Path(ifile).name))
|
|
444
445
|
self.write_message("Some keys are missing in the JSon file.\n")
|
|
445
446
|
self.write_message("{}\n".format("\n".join(['\t'+line for line in missing])))
|
|
@@ -472,7 +473,9 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
472
473
|
path = folder / path.name
|
|
473
474
|
|
|
474
475
|
if path.exists():
|
|
475
|
-
attachments.append(ITkDButils.Attachment(path,
|
|
476
|
+
attachments.append(ITkDButils.Attachment(path=path,
|
|
477
|
+
title=att["title"],
|
|
478
|
+
desc=att["description"]))
|
|
476
479
|
else:
|
|
477
480
|
self.write_message("Ignoring atachment {}".format(data["path"]))
|
|
478
481
|
|
|
@@ -596,15 +599,15 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
596
599
|
def upload_test(self):
|
|
597
600
|
"""Uploads tests and attachments."""
|
|
598
601
|
model = self.tree.get_model()
|
|
599
|
-
|
|
600
|
-
while
|
|
602
|
+
lv_iter = model.get_iter_first()
|
|
603
|
+
while lv_iter:
|
|
601
604
|
past_iter = None
|
|
602
|
-
values = model[
|
|
605
|
+
values = model[lv_iter]
|
|
603
606
|
payload = values[TestList.Json]
|
|
604
607
|
payload["comments"] = values[TestList.Comments]
|
|
605
608
|
payload["defects"] = values[TestList.Defects]
|
|
606
609
|
|
|
607
|
-
rc = ITkDButils.upload_test(self.session, payload, values[TestList.Attachments])
|
|
610
|
+
rc = ITkDButils.upload_test(self.session, payload, values[TestList.Attachments], check_runNumber=True)
|
|
608
611
|
if rc:
|
|
609
612
|
ipos = rc.find("The following details may help:")
|
|
610
613
|
msg = rc[ipos:]
|
|
@@ -613,9 +616,9 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
|
|
|
613
616
|
|
|
614
617
|
else:
|
|
615
618
|
self.write_message("Upload {}-{} successfull\n".format(payload["component"], payload["testType"]))
|
|
616
|
-
past_iter =
|
|
619
|
+
past_iter = lv_iter
|
|
617
620
|
|
|
618
|
-
|
|
621
|
+
lv_iter = model.iter_next(lv_iter)
|
|
619
622
|
if past_iter:
|
|
620
623
|
model.remove(past_iter)
|
|
621
624
|
|
|
@@ -5,7 +5,6 @@ import sys
|
|
|
5
5
|
from argparse import ArgumentParser
|
|
6
6
|
from datetime import datetime, timezone
|
|
7
7
|
from pathlib import Path
|
|
8
|
-
|
|
9
8
|
import dateutil.parser
|
|
10
9
|
import gi
|
|
11
10
|
|
|
@@ -16,7 +15,6 @@ try:
|
|
|
16
15
|
import itkdb_gtk
|
|
17
16
|
|
|
18
17
|
except ImportError:
|
|
19
|
-
from pathlib import Path
|
|
20
18
|
cwd = Path(__file__).parent.parent
|
|
21
19
|
sys.path.append(cwd.as_posix())
|
|
22
20
|
|
|
@@ -120,15 +118,17 @@ class AVSPanel(dbGtkUtils.ITkDBWindow):
|
|
|
120
118
|
|
|
121
119
|
self.btn_state = Gtk.Button(label="Undef")
|
|
122
120
|
self.btn_state.set_name("btnState")
|
|
121
|
+
self.btn_state.connect("clicked", self.show_state)
|
|
122
|
+
self.btn_state.set_tooltip_text("If green all good. Click to see commnets and defects.")
|
|
123
123
|
|
|
124
124
|
grid.attach(Gtk.Label(label="Serial No."), 0, 0, 1, 1)
|
|
125
125
|
grid.attach(self.SN, 1, 0, 1, 1)
|
|
126
126
|
grid.attach(self.btn_state, 2, 0, 1, 1)
|
|
127
|
-
|
|
127
|
+
|
|
128
128
|
|
|
129
129
|
grid.attach(Gtk.Label(label="Prod. Sheet"), 0, 1, 1, 1)
|
|
130
130
|
grid.attach(self.btnPSF, 1, 1, 1, 1)
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
btn = Gtk.Button(label="Reset")
|
|
133
133
|
btn.connect("clicked", self.on_reset)
|
|
134
134
|
grid.attach(btn, 2, 1, 1, 1)
|
|
@@ -209,7 +209,7 @@ class AVSPanel(dbGtkUtils.ITkDBWindow):
|
|
|
209
209
|
|
|
210
210
|
btn = Gtk.Button(label="Upload Tests")
|
|
211
211
|
btn.set_tooltip_text("Upload all tests")
|
|
212
|
-
|
|
212
|
+
|
|
213
213
|
btn.connect("clicked", self.on_upload)
|
|
214
214
|
btnBox.add(btn)
|
|
215
215
|
|
|
@@ -222,6 +222,44 @@ class AVSPanel(dbGtkUtils.ITkDBWindow):
|
|
|
222
222
|
|
|
223
223
|
self.show_all()
|
|
224
224
|
|
|
225
|
+
|
|
226
|
+
def show_state(self, *arg):
|
|
227
|
+
"""Shows the status"""
|
|
228
|
+
msg = ""
|
|
229
|
+
for test in self.test_list:
|
|
230
|
+
values = test.values
|
|
231
|
+
ndef = len(values["defects"])
|
|
232
|
+
ncomm = len(values["comments"])
|
|
233
|
+
if ndef==0 and ncomm==0:
|
|
234
|
+
continue
|
|
235
|
+
|
|
236
|
+
msg += "{}\n".format(values["testType"])
|
|
237
|
+
if ndef:
|
|
238
|
+
msg += "Defects\n"
|
|
239
|
+
|
|
240
|
+
for D in values["defects"]:
|
|
241
|
+
msg += "{}: {}\n".format(D["name"], D["description"])
|
|
242
|
+
|
|
243
|
+
if ncomm:
|
|
244
|
+
msg += "Comments\n"
|
|
245
|
+
|
|
246
|
+
for C in values["comments"]:
|
|
247
|
+
msg += "{}\n".format(C)
|
|
248
|
+
|
|
249
|
+
msg += "\n"
|
|
250
|
+
|
|
251
|
+
dialog = Gtk.MessageDialog(
|
|
252
|
+
transient_for=self,
|
|
253
|
+
flags=0,
|
|
254
|
+
message_type=Gtk.MessageType.INFO,
|
|
255
|
+
buttons=Gtk.ButtonsType.OK,
|
|
256
|
+
text="Problems found",
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
dialog.format_secondary_text(msg)
|
|
260
|
+
dialog.run()
|
|
261
|
+
dialog.destroy()
|
|
262
|
+
|
|
225
263
|
def on_reset(self, *args):
|
|
226
264
|
"""Reset SN"""
|
|
227
265
|
self.petal_core = None
|
|
@@ -361,7 +399,7 @@ class AVSPanel(dbGtkUtils.ITkDBWindow):
|
|
|
361
399
|
|
|
362
400
|
# Check if we need to assemble the module
|
|
363
401
|
self.check_assembly(self.DESY_comp)
|
|
364
|
-
|
|
402
|
+
|
|
365
403
|
self.check_components()
|
|
366
404
|
|
|
367
405
|
def on_fat_set(self, *args):
|
|
@@ -394,7 +432,7 @@ class AVSPanel(dbGtkUtils.ITkDBWindow):
|
|
|
394
432
|
self.update_scroll_window("delamination", j_del)
|
|
395
433
|
self.update_scroll_window("grounding", j_gnd)
|
|
396
434
|
self.update_scroll_window("metrology", j_mtr)
|
|
397
|
-
|
|
435
|
+
|
|
398
436
|
self.check_tests(True)
|
|
399
437
|
|
|
400
438
|
def read_avs_files(self, widgets):
|
|
@@ -473,7 +511,7 @@ class AVSPanel(dbGtkUtils.ITkDBWindow):
|
|
|
473
511
|
def on_check_components(self, *args):
|
|
474
512
|
"""Button clicked."""
|
|
475
513
|
self.check_components()
|
|
476
|
-
|
|
514
|
+
|
|
477
515
|
def check_components(self):
|
|
478
516
|
"""Check that components are in DB."""
|
|
479
517
|
for cmp, cmp_SN in self.DESY_comp.items():
|
|
@@ -558,7 +596,7 @@ class AVSPanel(dbGtkUtils.ITkDBWindow):
|
|
|
558
596
|
if rc is None:
|
|
559
597
|
print("Could not set final stage of {}".format(cSN))
|
|
560
598
|
|
|
561
|
-
if len(error_txt):
|
|
599
|
+
if len(error_txt)>0:
|
|
562
600
|
dbGtkUtils.complain("Assembly of {} could not be completeed:".format(this_petal),
|
|
563
601
|
"\n".join(error_txt))
|
|
564
602
|
|
|
@@ -670,7 +708,7 @@ class AVSPanel(dbGtkUtils.ITkDBWindow):
|
|
|
670
708
|
for test in self.test_list:
|
|
671
709
|
values = test.values
|
|
672
710
|
self.write_message("{}\n".format(values["testType"]))
|
|
673
|
-
res = ITkDButils.upload_test(self.session, values)
|
|
711
|
+
res = ITkDButils.upload_test(self.session, values, check_runNumber=True)
|
|
674
712
|
if res is not None:
|
|
675
713
|
dbGtkUtils.complain("Could not upload test {}".format(values["testType"]), res)
|
|
676
714
|
|
|
@@ -708,4 +746,4 @@ def main():
|
|
|
708
746
|
sys.exit()
|
|
709
747
|
|
|
710
748
|
if __name__ == "__main__":
|
|
711
|
-
main()
|
|
749
|
+
main()
|
itkdb_gtk/UploadTest.py
CHANGED
|
@@ -78,7 +78,7 @@ def check_data(data):
|
|
|
78
78
|
class UploadTest(dbGtkUtils.ITkDBWindow):
|
|
79
79
|
"""Collects information to upload a test and its attachments."""
|
|
80
80
|
|
|
81
|
-
def __init__(self, session, payload=None, attachment=None,
|
|
81
|
+
def __init__(self, session, payload=None, attachment=None, help_link=None):
|
|
82
82
|
"""Initialization.
|
|
83
83
|
|
|
84
84
|
Args:
|
|
@@ -107,7 +107,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
|
|
|
107
107
|
|
|
108
108
|
global gtk_runs
|
|
109
109
|
if gtk_runs:
|
|
110
|
-
super().__init__(session=session, title="Upload Test", gtk_runs=gtk_runs,
|
|
110
|
+
super().__init__(session=session, title="Upload Test", gtk_runs=gtk_runs, help_link=help_link)
|
|
111
111
|
self.init_window()
|
|
112
112
|
|
|
113
113
|
def init_window(self):
|
|
@@ -218,7 +218,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
|
|
|
218
218
|
|
|
219
219
|
except TypeError:
|
|
220
220
|
self.load_payload(self.payload)
|
|
221
|
-
self.write_message("Loaded memory payload
|
|
221
|
+
self.write_message("Loaded memory payload.\n")
|
|
222
222
|
|
|
223
223
|
if len(self.attachments) > 0:
|
|
224
224
|
self.btn_attch.set_label("Attachments ({})".format(len(self.attachments)))
|
|
@@ -366,7 +366,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
|
|
|
366
366
|
else:
|
|
367
367
|
the_path = Path(A["path"]).expanduser().resolve()
|
|
368
368
|
|
|
369
|
-
self.attachments.append(ITkDButils.Attachment(the_path, A["title"], A["description"]))
|
|
369
|
+
self.attachments.append(ITkDButils.Attachment(path=the_path, title=A["title"], desc=A["description"]))
|
|
370
370
|
|
|
371
371
|
if len(self.attachments) > 0:
|
|
372
372
|
self.btn_attch.set_label("Attachments ({})".format(len(self.attachments)))
|
|
@@ -444,7 +444,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
|
|
|
444
444
|
self.data["comments"] = self.comments
|
|
445
445
|
self.data["defects"] = self.defects
|
|
446
446
|
|
|
447
|
-
rc = ITkDButils.upload_test(self.session, self.data, self.attachments)
|
|
447
|
+
rc = ITkDButils.upload_test(self.session, self.data, self.attachments, check_runNumber=True)
|
|
448
448
|
if rc:
|
|
449
449
|
ipos = rc.find("The following details may help:")
|
|
450
450
|
msg = rc[ipos:]
|
|
@@ -482,9 +482,9 @@ def main():
|
|
|
482
482
|
# Start GUI
|
|
483
483
|
UpT = UploadTest(client,
|
|
484
484
|
payload=args.test_file,
|
|
485
|
-
attachment=ITkDButils.Attachment(args.attachment,
|
|
486
|
-
args.attach_title,
|
|
487
|
-
args.attach_desc))
|
|
485
|
+
attachment=ITkDButils.Attachment(path=args.attachment,
|
|
486
|
+
title=args.attach_title,
|
|
487
|
+
desc=args.attach_desc))
|
|
488
488
|
|
|
489
489
|
if gtk_runs:
|
|
490
490
|
UpT.present()
|