Example #1
0
    def getShipList(self):
        """
        Returns names and typeIDs of all the ships in the SDE

        Format: [[shipIDs], [shipNames]]
        """

        # First, get groupIDs of the Ships category (6)

        groupIDs = db.getGroupIDs(6)

        # Get shipIDs and shipNames

        shipIDs = []
        shipNames = []

        for i in range(0, len(groupIDs)):

            shipIDsTemp = db.getTypeIDs(groupIDs[i])
            shipIDs.extend(shipIDsTemp)

            for j in range(0, len(shipIDsTemp)):

                shipNames.append(db.getTypeName(shipIDsTemp[j]))

        # Sort by ship name alphabetically, while keeping the correct
        # typeID with the correct name

        shipIDs, shipNames = [
            list(x) for x in zip(*sorted(zip(shipIDs, shipNames), key=itemgetter(1)))]

        self.ships = [shipIDs, shipNames]
Example #2
0
    def getModuleList(self, val):
        """
        Updates the module list based off of the currently selected group.
        """

        idx = self.groupCombo.current()

        if idx != -1:

            groupID = self.groups[0][idx]

            moduleIDs = db.getTypeIDs(groupID)
            moduleNames = db.getTypeNames(groupID)

            self.moduleList = [moduleIDs, moduleNames]

            self.moduleCombo['values'] = self.moduleList[1]
            self.moduleCombo.set("Choose One...")