(file, desc, indexed)
| 22 | |
| 23 | |
| 24 | def write(file, desc, indexed): |
| 25 | fileh = tb.open_file(file, "w") |
| 26 | table = fileh.create_table(fileh.root, "table", desc) |
| 27 | for colname in indexed: |
| 28 | table.colinstances[colname].create_index() |
| 29 | |
| 30 | row = table.row |
| 31 | for i in range(10): |
| 32 | row["x"] = i |
| 33 | row["y"] = 10.2 - i |
| 34 | row["z"] = i |
| 35 | row["color"] = colors[random.choice(["red", "green", "blue"])] |
| 36 | row["info/name"] = "name%s" % i |
| 37 | row["info/info2/info3/z4"] = i |
| 38 | # All the rest will be filled with defaults |
| 39 | row.append() |
| 40 | |
| 41 | fileh.close() |
| 42 | |
| 43 | |
| 44 | # The sample nested class description |
no test coverage detected