(self, event)
| 103 | event.Skip() |
| 104 | |
| 105 | def OnImport(self, event): |
| 106 | with wx.FileDialog( |
| 107 | self, _t("Import pyfa override file"), |
| 108 | wildcard=_t("pyfa override file") + " (*.csv)|*.csv", |
| 109 | style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST |
| 110 | ) as dlg: |
| 111 | if dlg.ShowModal() == wx.ID_OK: |
| 112 | path = dlg.GetPath() |
| 113 | with open(path, 'r') as csvfile: |
| 114 | spamreader = csv.reader(csvfile) |
| 115 | for row in spamreader: |
| 116 | if len(row) == 0: # csvwriter seems to added blank lines to the end sometimes |
| 117 | continue |
| 118 | itemID, attrID, value = row |
| 119 | item = getItem(int(itemID)) |
| 120 | attr = getAttributeInfo(int(attrID)) |
| 121 | item.setOverride(attr, float(value)) |
| 122 | self.itemView.updateItems(True) |
| 123 | |
| 124 | def OnExport(self, event): |
| 125 | sMkt = Market.getInstance() |
nothing calls this directly
no test coverage detected