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

Method OnInputTimer

gui/fitBrowserLite.py:97–119  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

95 self.inputTimer.Start(self.sFit.serviceFittingOptions['marketSearchDelay'], True)
96
97 def OnInputTimer(self, event):
98 event.Skip()
99 searchPattern = self.searchBox.GetValue().strip()
100 if not searchPattern:
101 self.resetContents()
102 else:
103
104 def isMatch(fit, searchTokens):
105 for token in searchTokens:
106 if (
107 token not in fit.name.lower() and
108 token not in fit.shipName.lower() and
109 token not in fit.shipNameShort.lower()
110 ):
111 return False
112 return True
113
114 matches = []
115 searchTokens = [t.lower() for t in re.split(r'\s+', searchPattern)]
116 for fit in self.allFits:
117 if isMatch(fit, searchTokens):
118 matches.append(fit)
119 self.fromList.updateData(matches)
120
121 def OnFromListDclick(self, event):
122 event.Skip()

Callers

nothing calls this directly

Calls 4

resetContentsMethod · 0.95
updateDataMethod · 0.80
GetValueMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected