itkdb-gtk 0.10.10.dev5__tar.gz → 0.10.10.dev6__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 (42) hide show
  1. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/PKG-INFO +1 -1
  2. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/UploadMultipleTests.py +11 -2
  3. itkdb_gtk-0.10.10.dev5/itkdb_gtk/ModuleVisualInspection.py → itkdb_gtk-0.10.10.dev6/itkdb_gtk/VisualInspection.py +30 -5
  4. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/WireBondGui.py +49 -6
  5. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/__init__.py +4 -9
  6. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/dashBoard.py +28 -4
  7. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk.egg-info/PKG-INFO +1 -1
  8. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk.egg-info/SOURCES.txt +3 -3
  9. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk.egg-info/entry_points.txt +1 -2
  10. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/pyproject.toml +2 -3
  11. itkdb_gtk-0.10.10.dev6/test/testRange.py +58 -0
  12. itkdb_gtk-0.10.10.dev6/test/testThread.py +18 -0
  13. itkdb_gtk-0.10.10.dev5/itkdb_gtk/UploadPetalInformation.py +0 -749
  14. itkdb_gtk-0.10.10.dev5/itkdb_gtk/readAVSdata.py +0 -693
  15. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/README.md +0 -0
  16. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/CreateShipments.py +0 -0
  17. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/GetShipments.py +0 -0
  18. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/GlueWeight.py +0 -0
  19. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/ITkDB.desktop +0 -0
  20. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/ITkDB.svg +0 -0
  21. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/ITkDBlogin.py +0 -0
  22. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/ITkDButils.py +0 -0
  23. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/PanelVisualInspection.py +0 -0
  24. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/PetalReceptionTests.py +0 -0
  25. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/SensorUtils.py +0 -0
  26. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/ShowAttachments.py +0 -0
  27. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/ShowComments.py +0 -0
  28. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/ShowDefects.py +0 -0
  29. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/UploadModuleIV.py +0 -0
  30. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/UploadTest.py +0 -0
  31. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/dbGtkUtils.py +0 -0
  32. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/readGoogleSheet.py +0 -0
  33. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk/untrash_component.py +0 -0
  34. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk.egg-info/dependency_links.txt +0 -0
  35. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk.egg-info/requires.txt +0 -0
  36. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/itkdb_gtk.egg-info/top_level.txt +0 -0
  37. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/setup.cfg +0 -0
  38. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/test/testAnimated.py +0 -0
  39. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/test/testBatch.py +0 -0
  40. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/test/testComponent.py +0 -0
  41. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/test/test_attachment.py +0 -0
  42. {itkdb_gtk-0.10.10.dev5 → itkdb_gtk-0.10.10.dev6}/test/test_holes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: itkdb_gtk
3
- Version: 0.10.10.dev5
3
+ Version: 0.10.10.dev6
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
@@ -644,6 +644,8 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
644
644
  """Uploads tests and attachments."""
645
645
  model = self.tree.get_model()
646
646
  lv_iter = model.get_iter_first()
647
+ ngood = 0
648
+ nbad = 0
647
649
  while lv_iter:
648
650
  past_iter = None
649
651
  values = model[lv_iter]
@@ -655,17 +657,24 @@ class UploadMultipleTests(dbGtkUtils.ITkDBWindow):
655
657
  if rc:
656
658
  ipos = rc.find("The following details may help:")
657
659
  msg = rc[ipos:]
658
- dbGtkUtils.complain("Failed uploading test {}-{}".format(payload["component"], payload["testType"]), msg)
659
- self.write_message(msg)
660
+ dbGtkUtils.complain("Failed uploading test {}-{}".format(payload["component"], payload["testType"]))
661
+ self.write_message("Failed uploading test {}-{}\n{}\n".format(payload["component"], payload["testType"], msg))
662
+ nbad += 1
660
663
 
661
664
  else:
662
665
  self.write_message("Upload {}-{} successfull\n".format(payload["component"], payload["testType"]))
663
666
  past_iter = lv_iter
667
+ ngood += 1
664
668
 
665
669
  lv_iter = model.iter_next(lv_iter)
666
670
  if past_iter:
667
671
  model.remove(past_iter)
668
672
 
673
+ if nbad>0:
674
+ dbGtkUtils.complain("Failed to upload all tests", "{} test had errors.\nThey are left in the ListView.")
675
+ else:
676
+ dbGtkUtils.complain("All {} tests uploaded succesfully".format(ngood))
677
+
669
678
 
670
679
  def main():
671
680
  """Main entry."""
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env python3
2
2
  """Module Visual inspection GUI."""
3
3
  import sys
4
+ import re
4
5
  from pathlib import Path
5
6
 
6
7
  try:
@@ -22,10 +23,15 @@ from gi.repository import Gtk, Gio
22
23
 
23
24
  HELP_LINK="https://itkdb-gtk.docs.cern.ch/moduleVisualInspection.html"
24
25
 
26
+
27
+ module_type = re.compile("20USE(M[0-5]{1}|[345]{1}[LR]{1})[0-9]{7}")
28
+ sensor_type = re.compile("20USES[0-5]{1}[0-9]{7}")
29
+
30
+
25
31
  class ModuleVisualInspection(dbGtkUtils.ITkDBWindow):
26
- """Module Visual Inspection."""
32
+ """Module/Sensor Visual Inspection."""
27
33
 
28
- def __init__(self, session, title="Module Visual Inspection", help_link=HELP_LINK):
34
+ def __init__(self, session, title="Visual Inspection", help_link=HELP_LINK):
29
35
  super().__init__(title=title,
30
36
  session=session,
31
37
  show_search="Find object with given SN.",
@@ -72,6 +78,10 @@ class ModuleVisualInspection(dbGtkUtils.ITkDBWindow):
72
78
  self.SN.widget.set_tooltip_text("Enter SN of module.")
73
79
  grid.attach(self.SN.widget, 1, irow, 1, 1)
74
80
 
81
+ self.obj_type = None
82
+ self.obj_type_label = Gtk.Label()
83
+ grid.attach(self.obj_type_label, 2, irow, 1, 1)
84
+
75
85
  irow += 1
76
86
  lbl = Gtk.Label(label="Date")
77
87
  lbl.set_xalign(0)
@@ -144,6 +154,17 @@ class ModuleVisualInspection(dbGtkUtils.ITkDBWindow):
144
154
  return
145
155
 
146
156
  SN = module["serialNumber"]
157
+ if module_type.match(SN):
158
+ self.obj_type_label.set_text("Module")
159
+ self.obj_type = "MODULE"
160
+ elif sensor_type.match(SN):
161
+ self.obj_type_label.set_text("Sensor")
162
+ self.obj_type = "SENSOR"
163
+ else:
164
+ self.obj_type_label.set_text("Invalid SN")
165
+ self.obj_type = None
166
+ dbGtkUtils.complain("Invalid SN", "Not a module nor a sensor.")
167
+
147
168
  args[0].set_text(SN)
148
169
 
149
170
 
@@ -189,7 +210,7 @@ class ModuleVisualInspection(dbGtkUtils.ITkDBWindow):
189
210
  def upload_test(self, *args):
190
211
  """Upload the test."""
191
212
  SN = self.SN.get_text()
192
- if len(SN) == 0:
213
+ if len(SN) == 0 or self.obj_type is None:
193
214
  dbGtkUtils.complain("Invalid Serial Number", SN)
194
215
  return
195
216
 
@@ -201,9 +222,13 @@ class ModuleVisualInspection(dbGtkUtils.ITkDBWindow):
201
222
  "runNumber": "1",
202
223
  "date": self.date.get_text()
203
224
  }
225
+ test_type = "VISUAL_INSPECTION"
226
+ if self.obj_type == "SENSOR":
227
+ test_type = "VIS_INSP_RES_MOD_V2"
228
+
204
229
  self.data = ITkDButils.get_test_skeleton(self.session,
205
- "MODULE",
206
- "VISUAL_INSPECTION",
230
+ self.obj_type,
231
+ test_type,
207
232
  defaults)
208
233
 
209
234
  self.data["comments"] = self.comments
@@ -92,9 +92,38 @@ module_param = {
92
92
  ],
93
93
  }
94
94
 
95
+ module_to_tf = {
96
+ 0: [],
97
+ 1: [],
98
+ 2: [],
99
+ 3: [],
100
+ 4: [],
101
+ 5: []
102
+ }
103
+
104
+ hyb_to_pb = {
105
+ 0: [],
106
+ 1: [],
107
+ 2: [],
108
+ 3: [],
109
+ 4: [],
110
+ 5: []
111
+ }
112
+
113
+
95
114
  def range_to_list(V):
96
- """Convert a range (ch1-ch2) to a list."""
97
- if '-' not in V and ',' not in V:
115
+ """Convert a range to a list.
116
+
117
+ ch1-ch2 or ch1:ch2 -> [ch1, ch1+1, ch1+2, ..., ch2] or
118
+ ch1:step:ch2 -> [ch1, ch1+sep, ch1+2*step, ..., ch2]
119
+ """
120
+ nfound = 0
121
+ for c in "-:,":
122
+ if c in V:
123
+ nfound += 1
124
+ break
125
+
126
+ if nfound == 0:
98
127
  return [V]
99
128
 
100
129
  out = []
@@ -105,6 +134,21 @@ def range_to_list(V):
105
134
  endpoints.sort()
106
135
  for i in range(endpoints[0], endpoints[1]+1):
107
136
  out.append(str(i))
137
+ elif ':' in V:
138
+ endpoints = list(map(int, V.split(':')))
139
+ if len(endpoints) == 2:
140
+ endpoints.sort()
141
+ for i in range(endpoints[0], endpoints[1]+1):
142
+ out.append(str(i))
143
+
144
+ elif len(endpoints) == 3:
145
+ for i in range(endpoints[0], endpoints[2]+1, endpoints[1]):
146
+ out.append(str(i))
147
+
148
+ else:
149
+ print("Wring range specification. {}".format(V))
150
+ continue
151
+
108
152
  else:
109
153
  out.append(V)
110
154
 
@@ -330,12 +374,11 @@ class SensorHoles:
330
374
 
331
375
  This is ordered by row.
332
376
  """
333
- n_strip_row = 2*len(self.hybrids)
334
- mx_width = [0 for x in range(n_strip_row)]
377
+ mx_width = [0 for x in range(4)]
335
378
  for hyb in self.hybrids:
336
379
  mxW = hyb.get_max_consecutive()
337
- for j in range(4):
338
- mx_width[j] = max(mx_width[j] , mxW[j])
380
+ for j, val in enumerate(mxW):
381
+ mx_width[j] = max(mx_width[j] , val)
339
382
 
340
383
  return mx_width
341
384
 
@@ -1,6 +1,6 @@
1
1
  """ itkdb-gtk python module
2
2
  """
3
- __version__ = "0.10.10.dev5"
3
+ __version__ = "0.10.10.dev6"
4
4
 
5
5
 
6
6
  def dash_board():
@@ -53,17 +53,12 @@ def wirebondTest():
53
53
  from .WireBondGui import main
54
54
  main()
55
55
 
56
- def uploadPetalInformation():
57
- """Read files from AVS nd create Petal core in PDB."""
58
- from .UploadPetalInformation import main
59
- main()
60
-
61
56
  def panelVisualInspection():
62
57
  """Visual inspection of PWB or HYB panels."""
63
58
  from .PanelVisualInspection import main
64
59
  main()
65
60
 
66
- def moduleVisualInspection():
67
- """Visual inspection of Modules."""
68
- from .ModuleVisualInspection import main
61
+ def visualInspection():
62
+ """Visual inspection of Modules/Sensors."""
63
+ from .VisualInspection import main
69
64
  main()
@@ -22,7 +22,7 @@ from itkdb_gtk import GlueWeight
22
22
  from itkdb_gtk import UploadModuleIV
23
23
  from itkdb_gtk import WireBondGui
24
24
  from itkdb_gtk import PanelVisualInspection
25
- from itkdb_gtk import ModuleVisualInspection
25
+ from itkdb_gtk import VisualInspection
26
26
 
27
27
 
28
28
  HAS_PETALQC=False
@@ -30,6 +30,7 @@ try:
30
30
  from petal_qc.metrology.coreMetrology import CoreMetrology, CoreMetrologyOptions
31
31
  from petal_qc.thermal.coreThermal import CoreThermal
32
32
  from petal_qc.thermal.IRPetalParam import IRPetalParam
33
+ from petal_qc.metrology.uploadPetalInformation import AVSPanel, AVSOptions
33
34
 
34
35
  HAS_PETALQC = True
35
36
  except ImportError as E:
@@ -57,6 +58,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
57
58
  MODULE_VI = 10
58
59
  PETAL_CORE_METRO = 11
59
60
  PETAL_CORE_THERMAL = 12
61
+ PETAL_INFORMATION = 13
60
62
 
61
63
 
62
64
  def __init__(self, session):
@@ -113,12 +115,17 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
113
115
  btnPanelVI.connect("clicked", self.panel_VI)
114
116
  grid.attach(btnPanelVI, 1, irow, 1, 1)
115
117
 
116
- btnModVI = Gtk.Button(label="Module Visual Insp.")
118
+ btnModVI = Gtk.Button(label="Module/Sensor Visual Insp.")
117
119
  btnModVI.connect("clicked", self.module_VI)
118
120
  grid.attach(btnModVI, 0, irow, 1, 1)
119
121
 
120
122
 
121
123
  if HAS_PETALQC:
124
+ irow +=1
125
+ btnPetalInfo = Gtk.Button(label="AVS Petal Info")
126
+ btnPetalInfo.connect("clicked", self.upload_petal_info)
127
+ grid.attach(btnPetalInfo, 0, irow, 1, 1)
128
+
122
129
  irow +=1
123
130
  btnPetalMetrology = Gtk.Button(label="Petal Core Metrology")
124
131
  btnPetalMetrology.connect("clicked", self.petal_metrology)
@@ -262,18 +269,35 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
262
269
  return
263
270
 
264
271
  self.mask |= bt
265
- W = ModuleVisualInspection.ModuleVisualInspection(session=self.session,
266
- title="Module Visual Inspection",
272
+ W = VisualInspection.ModuleVisualInspection(session=self.session,
273
+ title="Module/Sensor Visual Inspection",
267
274
  help_link=HELP_LINK)
268
275
  W.connect("destroy", self.app_closed, bitn)
269
276
  W.show_all()
270
277
 
271
278
 
279
+ def upload_petal_info(self, *srgs):
280
+ """Upload petal Info."""
281
+ if not HAS_PETALQC:
282
+ return
283
+
284
+ bitn = DashWindow.PETAL_INFORMATION
285
+ bt = 1 << bitn
286
+ if self.mask & bt:
287
+ return
288
+
289
+ self.mask |= bt
290
+ W = AVSPanel(self.session, AVSOptions())
291
+ W.connect("destroy", self.app_closed, bitn)
292
+ W.show_all()
293
+
294
+
272
295
  def petal_metrology(self, *args):
273
296
  """Do petal metrology"""
274
297
  if not HAS_PETALQC:
275
298
  return
276
299
 
300
+
277
301
  bitn = DashWindow.PETAL_CORE_METRO
278
302
  bt = 1 << bitn
279
303
  if self.mask & bt:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: itkdb_gtk
3
- Version: 0.10.10.dev5
3
+ Version: 0.10.10.dev6
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
@@ -7,7 +7,6 @@ itkdb_gtk/ITkDB.desktop
7
7
  itkdb_gtk/ITkDB.svg
8
8
  itkdb_gtk/ITkDBlogin.py
9
9
  itkdb_gtk/ITkDButils.py
10
- itkdb_gtk/ModuleVisualInspection.py
11
10
  itkdb_gtk/PanelVisualInspection.py
12
11
  itkdb_gtk/PetalReceptionTests.py
13
12
  itkdb_gtk/SensorUtils.py
@@ -16,13 +15,12 @@ itkdb_gtk/ShowComments.py
16
15
  itkdb_gtk/ShowDefects.py
17
16
  itkdb_gtk/UploadModuleIV.py
18
17
  itkdb_gtk/UploadMultipleTests.py
19
- itkdb_gtk/UploadPetalInformation.py
20
18
  itkdb_gtk/UploadTest.py
19
+ itkdb_gtk/VisualInspection.py
21
20
  itkdb_gtk/WireBondGui.py
22
21
  itkdb_gtk/__init__.py
23
22
  itkdb_gtk/dashBoard.py
24
23
  itkdb_gtk/dbGtkUtils.py
25
- itkdb_gtk/readAVSdata.py
26
24
  itkdb_gtk/readGoogleSheet.py
27
25
  itkdb_gtk/untrash_component.py
28
26
  itkdb_gtk.egg-info/PKG-INFO
@@ -34,5 +32,7 @@ itkdb_gtk.egg-info/top_level.txt
34
32
  test/testAnimated.py
35
33
  test/testBatch.py
36
34
  test/testComponent.py
35
+ test/testRange.py
36
+ test/testThread.py
37
37
  test/test_attachment.py
38
38
  test/test_holes.py
@@ -3,11 +3,10 @@ createShipments = itkdb_gtk:createShipments
3
3
  getShipments = itkdb_gtk:getShipments
4
4
  glueWeight = itkdb_gtk:glueWeight
5
5
  itkdb_dashBoard = itkdb_gtk:dash_board
6
- moduleVisualInspection = itkdb_gtk:moduleVisualInspection
7
6
  panelVisualInspection = itkdb_gtk:panelVisualInspection
8
7
  petalReceptionTests = itkdb_gtk:petalReceptionTests
9
8
  uploadModuleIV = itkdb_gtk:uploadModuleIV
10
9
  uploadMultipleTests = itkdb_gtk:uploadMultipleTests
11
- uploadPetalInformation = itkdb_gtk:uploadPetalInformation
12
10
  uploadTest = itkdb_gtk:uploadTest
11
+ visualInspection = itkdb_gtk:visualInspection
13
12
  wirebondTest = itkdb_gtk:wirebondTest
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "itkdb_gtk"
7
- version = "0.10.10.dev5"
7
+ version = "0.10.10.dev6"
8
8
  authors = [
9
9
  { name="Carlos Lacasta", email="carlos.lacasta@cern.ch" },
10
10
  ]
@@ -36,9 +36,8 @@ uploadTest = "itkdb_gtk:uploadTest"
36
36
  uploadMultipleTests = "itkdb_gtk:uploadMultipleTests"
37
37
  uploadModuleIV = "itkdb_gtk:uploadModuleIV"
38
38
  wirebondTest = "itkdb_gtk:wirebondTest"
39
- uploadPetalInformation = "itkdb_gtk:uploadPetalInformation"
40
39
  panelVisualInspection = "itkdb_gtk:panelVisualInspection"
41
- moduleVisualInspection = "itkdb_gtk:moduleVisualInspection"
40
+ visualInspection = "itkdb_gtk:visualInspection"
42
41
 
43
42
  [tool.setuptools]
44
43
  include-package-data = true
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env python3
2
+ """Tests the range parser."""
3
+ def range_to_list(V):
4
+ """Convert a range to a list.
5
+
6
+ ch1-ch2 or ch1:ch2 -> [ch1, ch1+1, ch1+2, ..., ch2] or
7
+ ch1:step:ch2 -> [ch1, ch1+sep, ch1+2*step, ..., ch2]
8
+ """
9
+ nfound = 0
10
+ for c in "-:,":
11
+ if c in V:
12
+ nfound += 1
13
+ break
14
+
15
+ if nfound == 0:
16
+ return [V]
17
+
18
+ out = []
19
+ values = V.split(',')
20
+ for V in values:
21
+ if '-' in V:
22
+ endpoints = list(map(int, V.split('-')))
23
+ endpoints.sort()
24
+ for i in range(endpoints[0], endpoints[1]+1):
25
+ out.append(str(i))
26
+ elif ':' in V:
27
+ endpoints = list(map(int, V.split(':')))
28
+ if len(endpoints) == 2:
29
+ endpoints.sort()
30
+ for i in range(endpoints[0], endpoints[1]+1):
31
+ out.append(str(i))
32
+
33
+ elif len(endpoints) == 3:
34
+ for i in range(endpoints[0], endpoints[2]+1, endpoints[1]):
35
+ out.append(str(i))
36
+
37
+ else:
38
+ print("Wring range specification. {}".format(V))
39
+ continue
40
+
41
+ else:
42
+ out.append(V)
43
+
44
+ return out
45
+
46
+ def main():
47
+ r = "1-5"
48
+ print(r, range_to_list(r))
49
+
50
+ r = "1:5"
51
+ print(r, range_to_list(r))
52
+
53
+ r = "1:2:12"
54
+ print(r, range_to_list(r))
55
+
56
+
57
+ if __name__ == "__main__":
58
+ main()
@@ -0,0 +1,18 @@
1
+ import threading
2
+
3
+
4
+ class Test:
5
+ def __init__(self):
6
+ self.a = "a"
7
+ self.T = threading.Thread(target=self.my_method, args=["zzz"])
8
+
9
+ def my_method(self, x):
10
+ print("Hole: {}".format(x))
11
+
12
+ def start(self):
13
+ self.T.start()
14
+
15
+
16
+ T = Test()
17
+ T.start()
18
+