MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / OnImport

Method OnImport

gui/propertyEditor.py:105–122  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 5

getItemFunction · 0.90
getAttributeInfoFunction · 0.90
setOverrideMethod · 0.80
updateItemsMethod · 0.80
_tFunction · 0.50

Tested by

no test coverage detected