(self, data)
| 523 | self.Layout() |
| 524 | |
| 525 | def populateSkillTree(self, data): |
| 526 | if data is None: |
| 527 | return |
| 528 | root = self.root |
| 529 | tree = self.fittingsTreeCtrl |
| 530 | tree.DeleteChildren(root) |
| 531 | |
| 532 | sEsi = Esi.getInstance() |
| 533 | |
| 534 | dict = {} |
| 535 | fits = data |
| 536 | for fit in fits: |
| 537 | if fit['fitting_id'] in sEsi.fittings_deleted: |
| 538 | continue |
| 539 | ship = getItem(fit['ship_type_id']) |
| 540 | if ship is None: |
| 541 | pyfalog.debug('Cannot find ship type id: {}'.format(fit['ship_type_id'])) |
| 542 | continue |
| 543 | if ship.name not in dict: |
| 544 | dict[ship.name] = [] |
| 545 | dict[ship.name].append(fit) |
| 546 | |
| 547 | for name, fits in dict.items(): |
| 548 | shipID = tree.AppendItem(root, name) |
| 549 | for fit in fits: |
| 550 | fitId = tree.AppendItem(shipID, fit['name']) |
| 551 | tree.SetItemData(fitId, json.dumps(fit)) |
| 552 | |
| 553 | tree.SortChildren(root) |
| 554 | |
| 555 | def displayFit(self, event): |
| 556 | selection = self.fittingsTreeCtrl.GetSelection() |
no test coverage detected