Pyfa
Pyfa copied to clipboard
Add button to search contracts for abyssal modules
It would be nice if Pyfa had a button that would open up a search for a specific abyssal module.
It could look similar to this:
The required change for that should also be pretty straight forward:
# ItemMutator.py
# ...
import webbrowser
class ItemMutatorPanel():
def __init__(self, parent):
# ...
self.searchContractsBtn = wx.Button(self, label="Search contracts")
self.searchContractsBtn.Bind(wx.EVT_BUTTON, self.OnSearchContracts)
footerSizer.Add(self.searchContractsBtn, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
# ...
def OnSearchContracts(self, event):
baseUrl = "https://mutamarket.com/modules/"
typeString = f"type/{self.stuff.item.name.replace(' ', '-')}/"
attributeString = "attributes/"
for attribute in self.mutaList.stuff.mutators.values():
attributeString += f"{attribute.attribute.name}/{attribute.value}/"
attributeString = attributeString[:-1]
url = baseUrl + typeString + attributeString
webbrowser.open(url)
I'm happy to discuss other option too!