From f6932bc5358d6b75d838165733f00be77aca2316 Mon Sep 17 00:00:00 2001 From: Corollax Date: Sat, 30 Oct 2010 15:16:55 -0500 Subject: [PATCH] Tentative update to market.py Moves limited edition ships to their own category --- service/market.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/service/market.py b/service/market.py index 6c2eac222..f2abda1d3 100644 --- a/service/market.py +++ b/service/market.py @@ -113,7 +113,7 @@ class SearchWorkerThread(threading.Thread): class Market(): instance = None - FORCED_SHIPS = ("Freki", "Mimir", "Utu", "Adrestia", "Ibis", "Impairor", "Velator", "Reaper") + FORCED_SHIPS = ("Ibis", "Impairor", "Velator", "Reaper") FORCED_GROUPS = ("Rookie ship",) META_MAP = {"normal": (1, 2, 14), "faction": (4, 3), @@ -161,18 +161,27 @@ class Market(): def getShipRoot(self): cat = eos.db.getCategory(6) - root = [] + root = [(-1, "Limited Issue Ships")] for grp in cat.groups: - if grp.published or grp.name in self.FORCED_GROUPS: + if grp.published or grp.name in self.FORCED_GROUPS: root.append((grp.ID, grp.name)) return root + + LIMITED_EDITION = ("Gold Magnate", "Silver Magnate", "Guardian-Vexor", "Opux Luxury Yacht", "Armageddon Imperial Issue", "Apocalypse Imperial Issue", "Raven State Issue", "Megathron Federate Issue", "Tempest Tribal Issue", "Apotheosis", "Zephyr", "Primae", "Mimir", "Freki", "Adrestia", "Utu") def getShipList(self, id): ships = [] + if id == -1: + for name in self.LIMITED_EDITION: + item = eos.db.getItem(name) + ships.append((item.ID, item.name, item.race)) + + return ships + grp = eos.db.getGroup(id, eager=("items", "items.marketGroup", "items.attributes")) for item in grp.items: - if item.published or item.name in self.FORCED_SHIPS: + if (item.published or item.name in self.FORCED_SHIPS) and item.name not in self.LIMITED_EDITION: ships.append((item.ID, item.name, item.race)) return ships