MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / _get_sort_key

Method _get_sort_key

gui/builtinViews/fittingView.py:563–571  ·  view source on GitHub ↗
(mod)

Source from the content-addressed store, hash-verified

561 self.mods = [mod for mod in fit.modules if mod is not None]
562
563 def _get_sort_key(mod):
564 slot = getattr(mod, "slot", None)
565 try:
566 slot_index = slotOrder.index(slot)
567 except ValueError:
568 # During rapid fit switches we may briefly see transient modules
569 # with unresolved slot references; keep UI stable by sorting them last.
570 slot_index = len(slotOrder)
571 return slot_index, getattr(mod, "position", 0)
572
573 self.mods.sort(key=_get_sort_key)
574

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected