Process market tree expands
(self, event)
| 49 | return self.imageList.GetImageIndex(iconFile, location) |
| 50 | |
| 51 | def expandLookup(self, event): |
| 52 | """Process market tree expands""" |
| 53 | root = event.Item |
| 54 | child = self.GetFirstChild(root)[0] |
| 55 | # If child of given market group is a dummy |
| 56 | if self.GetItemText(child) == "dummy": |
| 57 | # Delete it |
| 58 | self.Delete(child) |
| 59 | # And add real market group contents |
| 60 | sMkt = self.sMkt |
| 61 | currentMktGrp = sMkt.getMarketGroup(self.GetItemData(root), eager="children") |
| 62 | |
| 63 | for childMktGrp in sMkt.getMarketGroupChildren(currentMktGrp): |
| 64 | # If market should have items but it doesn't, do not show it |
| 65 | if sMkt.marketGroupValidityCheck(childMktGrp) is False: |
| 66 | continue |
| 67 | icon = sMkt.getIconByMarketGroup(childMktGrp) |
| 68 | iconId = -1 if icon is None else self.addImage(icon) |
| 69 | try: |
| 70 | childId = self.AppendItem(root, childMktGrp.name, iconId, data=childMktGrp.ID) |
| 71 | except (KeyboardInterrupt, SystemExit): |
| 72 | raise |
| 73 | except Exception as e: |
| 74 | pyfalog.debug("Error appending item.") |
| 75 | pyfalog.debug(e) |
| 76 | continue |
| 77 | if sMkt.marketGroupHasTypesCheck(childMktGrp) is False: |
| 78 | self.AppendItem(childId, "dummy") |
| 79 | |
| 80 | self.SortChildren(root) |
| 81 | |
| 82 | def OnCollapsed(self, event): |
| 83 | self.CollapseAllChildren(event.Item) |
nothing calls this directly
no test coverage detected