예제 #1
0
파일: market.py 프로젝트: potatoi/Pyfa
    def __init__(self):

        # Init recently used module storage
        serviceMarketRecentlyUsedModules = {
            "pyfaMarketRecentlyUsedModules": []
        }

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance(
        ).getSettings("pyfaMarketRecentlyUsedModules",
                      serviceMarketRecentlyUsedModules)

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = types_Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Opux Luxury Yacht": self.les_grp,
            # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate": self.les_grp,  # Amarr Championship prize
            "Gold Magnate": self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Guardian-Vexor": self.
            les_grp,  # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue":
            self.les_grp,  # Reward during Crielere event
            "Raven State Issue": self.les_grp,  # AT4 prize
            "Tempest Tribal Issue": self.les_grp,  # AT4 prize
            "Apotheosis": self.les_grp,  # 5th EVE anniversary present
            "Zephyr": self.les_grp,  # 2010 new year gift
            "Primae": self.les_grp,  # Promotion of planetary interaction
            "Council Diplomatic Shuttle": self.les_grp,  # CSM X celebration
            "Freki": self.les_grp,  # AT7 prize
            "Mimir": self.les_grp,  # AT7 prize
            "Utu": self.les_grp,  # AT8 prize
            "Adrestia": self.les_grp,  # AT8 prize
            "Echelon": self.les_grp,  # 2011 new year gift
            "Malice": self.les_grp,  # AT9 prize
            "Vangel": self.les_grp,  # AT9 prize
            "Cambion": self.les_grp,  # AT10 prize
            "Etana": self.les_grp,  # AT10 prize
            "Chremoas": self.les_grp,  # AT11 prize :(
            "Moracha": self.les_grp,  # AT11 prize
            "Stratios Emergency Responder":
            self.les_grp,  # Issued for Somer Blink lottery
            "Miasmos Quafe Ultra Edition":
            self.les_grp,  # Gift to people who purchased FF HD stream
            "InterBus Shuttle": self.les_grp,
            "Leopard": self.les_grp,  # 2013 new year gift
            "Whiptail": self.les_grp,  # AT12 prize
            "Chameleon": self.les_grp,  # AT12 prize
            "Victorieux Luxury Yacht":
            self.les_grp,  # Worlds Collide prize \o/ chinese getting owned
            "Imp": self.les_grp,  # AT13 prize
            "Fiend": self.les_grp,  # AT13 prize
            "Caedes": self.les_grp,  # AT14 prize
            "Rabisu": self.les_grp,  # AT14 prize
        }

        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        self.les_grp.addItems = list(
            self.getItem(itmn)
            for itmn in self.ITEMS_FORCEGROUP_R[self.les_grp])
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Data Subverter I":
            False,  # Not used in EVE, probably will appear with Dust link
            "QA Cross Protocol Analyzer":
            False,  # QA modules used by CCP internally
            "QA Damage Module": False,
            "QA ECCM": False,
            "QA Immunity Module": False,
            "QA Multiship Module - 10 Players": False,
            "QA Multiship Module - 20 Players": False,
            "QA Multiship Module - 40 Players": False,
            "QA Multiship Module - 5 Players": False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players": False,
            "Goru's Shuttle": False,
            "Guristas Shuttle": False,
            "Mobile Decoy Unit":
            False,  # Seems to be left over test mod for deployables
            "Tournament Micro Jump Unit":
            False,  # Normally seen only on tournament arenas
            "Civilian Gatling Railgun": True,
            "Civilian Gatling Pulse Laser": True,
            "Civilian Gatling Autocannon": True,
            "Civilian Light Electron Blaster": True,
        }

        # do not publish ships that we convert
        for name in conversions.packs['skinnedShips']:
            self.ITEMS_FORCEPUBLISHED[name] = False

        if config.debug:
            # Publish Tactical Dessy Modes if in debug
            # Cannot use GROUPS_FORCEPUBLISHED as this does not force items
            # within group to be published, but rather for the group itself
            # to show up on ship list
            group = self.getGroup("Ship Modifiers", eager="items")
            for item in group.items:
                self.ITEMS_FORCEPUBLISHED[item.name] = True

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False
        }  # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I": ("Storyline", "Miner I"),
            "'Wild' Miner I": ("Storyline", "Miner I"),
            "Medium Nano Armor Repair Unit I":
            ("Tech I", "Medium Armor Repairer I"),
            "Large 'Reprieve' Vestment Reconstructer I":
            ("Storyline", "Large Armor Repairer I"),
            "Khanid Navy Torpedo Launcher": ("Faction", "Torpedo Launcher I"),
        }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in self.ITEMS_FORCEDMETAGROUP.items():
            parent = value[1]
            if parent not in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "'Alpha' Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Codex' Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Daemon' Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "'Libram' Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Advanced Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Civilian Damage Control":
            615,  # Ship Equipment > Hull & Armor > Damage Controls
            "Civilian EM Ward Field": 1695,
            # Ship Equipment > Shield > Shield Hardeners > EM Shield Hardeners
            "Civilian Explosive Deflection Field": 1694,
            # Ship Equipment > Shield > Shield Hardeners > Explosive Shield Hardeners
            "Civilian Hobgoblin":
            837,  # Drones > Combat Drones > Light Scout Drones
            "Civilian Kinetic Deflection Field": 1693,
            # Ship Equipment > Shield > Shield Hardeners > Kinetic Shield Hardeners
            "Civilian Light Missile Launcher": 640,
            # Ship Equipment > Turrets & Bays > Missile Launchers > Light Missile Launchers
            "Civilian Scourge Light Missile": 920,
            # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Small Remote Armor Repairer": 1059,
            # Ship Equipment > Hull & Armor > Remote Armor Repairers > Small
            "Civilian Small Remote Shield Booster":
            603,  # Ship Equipment > Shield > Remote Shield Boosters > Small
            "Civilian Stasis Webifier":
            683,  # Ship Equipment > Electronic Warfare > Stasis Webifiers
            "Civilian Thermic Dissipation Field": 1692,
            # Ship Equipment > Shield > Shield Hardeners > Thermal Shield Hardeners
            "Civilian Warp Disruptor":
            1935,  # Ship Equipment > Electronic Warfare > Warp Disruptors
            "Hardwiring - Zainou 'Sharpshooter' ZMX10": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX100": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX11": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX110": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Nugoehuvi Synth Blue Pill Booster":
            977,  # Implants & Boosters > Booster
            "Prototype Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Prototype Iris Probe Launcher":
            712,  # Ship Equipment > Turrets & Bays > Scan Probe Launchers
            "Shadow": 1310,  # Drones > Combat Drones > Fighter Bombers
            "Sleeper Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Standard Cerebral Accelerator":
            977,  # Implants & Boosters > Booster
            "Talocan Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Terran Data Analyzer I": 714,
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
            "Tetrimon Data Analyzer I": 714
            # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners
        }

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(
            self.ITEMS_FORCEDMARKETGROUP)

        self.FORCEDMARKETGROUP = {
            685: False,  # Ship Equipment > Electronic Warfare > ECCM
            681:
            False,  # Ship Equipment > Electronic Warfare > Sensor Backup Arrays
        }

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("normal", frozenset((0, 1, 2, 14))),
                                     ("faction", frozenset((4, 3))),
                                     ("complex", frozenset((6, ))),
                                     ("officer", frozenset((5, )))])
        self.SEARCH_CATEGORIES = (
            "Drone",
            "Module",
            "Subsystem",
            "Charge",
            "Implant",
            "Deployable",
            "Fighter",
            "Structure",
            "Structure Module",
        )
        self.SEARCH_GROUPS = ("Ice Product", )
        self.ROOT_MARKET_GROUPS = (
            9,  # Modules
            1111,  # Rigs
            157,  # Drones
            11,  # Ammo
            1112,  # Subsystems
            24,  # Implants & Boosters
            404,  # Deployables
            2202,  # Structure Equipment
            2203  # Structure Modifications
        )
        # Tell other threads that Market is at their service
        mktRdy.set()
예제 #2
0
    def __init__(self):

        # Init recently used module storage
        serviceMarketRecentlyUsedModules = {
            "pyfaMarketRecentlyUsedModules": []
        }

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance(
        ).getSettings("pyfaMarketRecentlyUsedModules",
                      serviceMarketRecentlyUsedModules)

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = types_Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Capsule": self.getGroup("Shuttle"),
            "Opux Luxury Yacht": self.
            les_grp,  # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate": self.les_grp,  # Amarr Championship prize
            "Gold Magnate": self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue":
            self.les_grp,  # Amarr Championship prize
            "Guardian-Vexor": self.
            les_grp,  # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue":
            self.les_grp,  # Reward during Crielere event
            "Raven State Issue": self.les_grp,  # AT4 prize
            "Tempest Tribal Issue": self.les_grp,  # AT4 prize
            "Apotheosis": self.les_grp,  # 5th EVE anniversary present
            "Zephyr": self.les_grp,  # 2010 new year gift
            "Primae": self.les_grp,  # Promotion of planetary interaction
            "Council Diplomatic Shuttle": self.les_grp,  # CSM X celebration
            "Freki": self.les_grp,  # AT7 prize
            "Mimir": self.les_grp,  # AT7 prize
            "Utu": self.les_grp,  # AT8 prize
            "Adrestia": self.les_grp,  # AT8 prize
            "Echelon": self.les_grp,  # 2011 new year gift
            "Malice": self.les_grp,  # AT9 prize
            "Vangel": self.les_grp,  # AT9 prize
            "Cambion": self.les_grp,  # AT10 prize
            "Etana": self.les_grp,  # AT10 prize
            "Chremoas": self.les_grp,  # AT11 prize :(
            "Moracha": self.les_grp,  # AT11 prize
            "Stratios Emergency Responder":
            self.les_grp,  # Issued for Somer Blink lottery
            "Miasmos Quafe Ultra Edition":
            self.les_grp,  # Gift to people who purchased FF HD stream
            "InterBus Shuttle": self.les_grp,
            "Leopard": self.les_grp,  # 2013 new year gift
            "Whiptail": self.les_grp,  # AT12 prize
            "Chameleon": self.les_grp,  # AT12 prize
            "Victorieux Luxury Yacht":
            self.les_grp,  # Worlds Collide prize \o/ chinese getting owned
            "Imp": self.les_grp,  # AT13 prize
            "Fiend": self.les_grp,  # AT13 prize
            "Caedes": self.les_grp,  # AT14 prize
            "Rabisu": self.les_grp,  # AT14 prize
            "Victor": self.les_grp,  # AT15 prize
            "Virtuoso": self.les_grp,  # AT15 prize
            "Hydra": self.les_grp,  # AT16 prize
            "Tiamat": self.les_grp,  # AT16 prize
        }

        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        for grp, itemNames in self.ITEMS_FORCEGROUP_R.items():
            grp.addItems = list(self.getItem(i) for i in itemNames)
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Data Subverter I":
            False,  # Not used in EVE, probably will appear with Dust link
            "QA Cross Protocol Analyzer":
            False,  # QA modules used by CCP internally
            "QA Damage Module": False,
            "QA ECCM": False,
            "QA Immunity Module": False,
            "QA Multiship Module - 10 Players": False,
            "QA Multiship Module - 20 Players": False,
            "QA Multiship Module - 40 Players": False,
            "QA Multiship Module - 5 Players": False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players": False,
            "Goru's Shuttle": False,
            "Guristas Shuttle": False,
            "Mobile Decoy Unit":
            False,  # Seems to be left over test mod for deployables
            "Tournament Micro Jump Unit":
            False,  # Normally seen only on tournament arenas
        }

        # do not publish ships that we convert
        for name in conversions.packs['skinnedShips']:
            self.ITEMS_FORCEPUBLISHED[name] = False

        if config.debug:
            # Publish Tactical Dessy Modes if in debug
            # Cannot use GROUPS_FORCEPUBLISHED as this does not force items
            # within group to be published, but rather for the group itself
            # to show up on ship list
            group = self.getGroup("Ship Modifiers", eager="items")
            for item in group.items:
                self.ITEMS_FORCEPUBLISHED[item.name] = True

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False
        }  # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I": ("Storyline", "Miner I"),
            "'Wild' Miner I": ("Storyline", "Miner I"),
            "Khanid Navy Torpedo Launcher": ("Faction", "Torpedo Launcher I"),
            "Dark Blood Tracking Disruptor":
            ("Faction", "Tracking Disruptor I"),
            "Dread Guristas Standup Variable Spectrum ECM":
            ("Structure Faction", "Standup Variable Spectrum ECM I"),
            "Dark Blood Standup Heavy Energy Neutralizer":
            ("Structure Faction", "Standup Heavy Energy Neutralizer I")
        }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in list(self.ITEMS_FORCEDMETAGROUP.items()):
            parent = value[1]
            if parent not in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "Advanced Cerebral Accelerator":
            2487,  # Implants & Boosters > Booster > Cerebral Accelerators
            "Civilian Hobgoblin":
            837,  # Drones > Combat Drones > Light Scout Drones
            "Civilian Light Missile Launcher":
            640,  # Ship Equipment > Turrets & Launchers > Missile Launchers > Light Missile Launchers
            "Civilian Scourge Light Missile":
            920,  # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Small Remote Armor Repairer":
            1059,  # Ship Equipment > Hull & Armor > Remote Armor Repairers > Small
            "Civilian Small Remote Shield Booster":
            603,  # Ship Equipment > Shield > Remote Shield Boosters > Small
            "Hardwiring - Zainou 'Sharpshooter' ZMX10":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX11":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX110":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100":
            1493,  # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Prototype Cerebral Accelerator":
            2487,  # Implants & Boosters > Booster > Cerebral Accelerators
            "Prototype Iris Probe Launcher":
            712,  # Ship Equipment > Scanning Equipment > Scan Probe Launchers
            "Standard Cerebral Accelerator":
            2487,  # Implants & Boosters > Booster > Cerebral Accelerators
        }

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(
            self.ITEMS_FORCEDMARKETGROUP)

        self.FORCEDMARKETGROUP = {
            685: False,  # Ship Equipment > Electronic Warfare > ECCM
            681:
            False,  # Ship Equipment > Electronic Warfare > Sensor Backup Arrays
            1639:
            False,  # Ship Equipment > Fleet Assistance > Command Processors
            2527:
            True,  # Ship Equipment > Hull & Armor > Mutadaptive Remote Armor Repairers - has hasTypes set to 1 while actually having no types
        }

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("faction", frozenset((4, 3, 52))),
                                     ("complex", frozenset((6, ))),
                                     ("officer", frozenset((5, )))])
        nonNormalMetas = set(chain(*self.META_MAP.values()))
        self.META_MAP["normal"] = frozenset(
            (0, *(mg.ID for mg in eos.db.getMetaGroups()
                  if mg.ID not in nonNormalMetas)))
        self.META_MAP.move_to_end("normal", last=False)
        self.META_MAP_REVERSE = {
            sv: k
            for k, v in self.META_MAP.items() for sv in v
        }
        self.META_MAP_REVERSE_INDICES = self.__makeReverseMetaMapIndices()
        self.SEARCH_CATEGORIES = (
            "Drone",
            "Module",
            "Subsystem",
            "Charge",
            "Implant",
            "Deployable",
            "Fighter",
            "Structure",
            "Structure Module",
        )
        self.SEARCH_GROUPS = ("Ice Product", "Cargo Container",
                              "Secure Cargo Container",
                              "Audit Log Secure Container",
                              "Freight Container")
        self.ROOT_MARKET_GROUPS = (
            9,  # Ship Equipment
            1111,  # Rigs
            157,  # Drones
            11,  # Ammunition & Charges
            1112,  # Subsystems
            24,  # Implants & Boosters
            404,  # Deployable Structures
            2202,  # Structure Equipment
            2203  # Structure Modifications
        )
        self.SHOWN_MARKET_GROUPS = eos.db.getMarketTreeNodeIds(
            self.ROOT_MARKET_GROUPS)
        self.FIT_CATEGORIES = ['Ship']
        self.FIT_GROUPS = ['Citadel', 'Engineering Complex', 'Refinery']
        # Tell other threads that Market is at their service
        mktRdy.set()
예제 #3
0
파일: market.py 프로젝트: Sectoid/Pyfa
    def __init__(self):

        # Init recently used module storage
        serviceMarketRecentlyUsedModules = {"pyfaMarketRecentlyUsedModules": []}

        self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance().getSettings(
                "pyfaMarketRecentlyUsedModules", serviceMarketRecentlyUsedModules)

        # Thread which handles search
        self.searchWorkerThread = SearchWorkerThread()
        self.searchWorkerThread.daemon = True
        self.searchWorkerThread.start()

        # Ship browser helper thread
        self.shipBrowserWorkerThread = ShipBrowserWorkerThread()
        self.shipBrowserWorkerThread.daemon = True
        self.shipBrowserWorkerThread.start()

        # Items' group overrides
        self.customGroups = set()
        # Limited edition ships
        self.les_grp = types_Group()
        self.les_grp.ID = -1
        self.les_grp.name = "Limited Issue Ships"
        self.les_grp.published = True
        ships = self.getCategory("Ship")
        self.les_grp.category = ships
        self.les_grp.categoryID = ships.ID
        self.les_grp.description = ""
        self.les_grp.icon = None
        self.ITEMS_FORCEGROUP = {
            "Opux Luxury Yacht"           : self.les_grp,
            # One of those is wedding present at CCP fanfest, another was hijacked from ISD guy during an event
            "Silver Magnate"              : self.les_grp,  # Amarr Championship prize
            "Gold Magnate"                : self.les_grp,  # Amarr Championship prize
            "Armageddon Imperial Issue"   : self.les_grp,  # Amarr Championship prize
            "Apocalypse Imperial Issue"   : self.les_grp,  # Amarr Championship prize
            "Guardian-Vexor"              : self.les_grp,  # Illegal rewards for the Gallente Frontier Tour Lines event arc
            "Megathron Federate Issue"    : self.les_grp,  # Reward during Crielere event
            "Raven State Issue"           : self.les_grp,  # AT4 prize
            "Tempest Tribal Issue"        : self.les_grp,  # AT4 prize
            "Apotheosis"                  : self.les_grp,  # 5th EVE anniversary present
            "Zephyr"                      : self.les_grp,  # 2010 new year gift
            "Primae"                      : self.les_grp,  # Promotion of planetary interaction
            "Council Diplomatic Shuttle"  : self.les_grp,  # CSM X celebration
            "Freki"                       : self.les_grp,  # AT7 prize
            "Mimir"                       : self.les_grp,  # AT7 prize
            "Utu"                         : self.les_grp,  # AT8 prize
            "Adrestia"                    : self.les_grp,  # AT8 prize
            "Echelon"                     : self.les_grp,  # 2011 new year gift
            "Malice"                      : self.les_grp,  # AT9 prize
            "Vangel"                      : self.les_grp,  # AT9 prize
            "Cambion"                     : self.les_grp,  # AT10 prize
            "Etana"                       : self.les_grp,  # AT10 prize
            "Chremoas"                    : self.les_grp,  # AT11 prize :(
            "Moracha"                     : self.les_grp,  # AT11 prize
            "Stratios Emergency Responder": self.les_grp,  # Issued for Somer Blink lottery
            "Miasmos Quafe Ultra Edition" : self.les_grp,  # Gift to people who purchased FF HD stream
            "InterBus Shuttle"            : self.les_grp,
            "Leopard"                     : self.les_grp,  # 2013 new year gift
            "Whiptail"                    : self.les_grp,  # AT12 prize
            "Chameleon"                   : self.les_grp,  # AT12 prize
            "Victorieux Luxury Yacht"     : self.les_grp,  # Worlds Collide prize \o/ chinese getting owned
            "Imp"                         : self.les_grp,  # AT13 prize
            "Fiend"                       : self.les_grp,  # AT13 prize
            "Caedes"                      : self.les_grp,  # AT14 prize
            "Rabisu"                      : self.les_grp,  # AT14 prize
            "Victor"                      : self.les_grp,  # AT prize
            "Virtuoso"                    : self.les_grp,  # AT prize
        }

        self.ITEMS_FORCEGROUP_R = self.__makeRevDict(self.ITEMS_FORCEGROUP)
        self.les_grp.addItems = list(self.getItem(itmn) for itmn in self.ITEMS_FORCEGROUP_R[self.les_grp])
        self.customGroups.add(self.les_grp)

        # List of items which are forcibly published or hidden
        self.ITEMS_FORCEPUBLISHED = {
            "Data Subverter I"                         : False,  # Not used in EVE, probably will appear with Dust link
            "QA Cross Protocol Analyzer"               : False,  # QA modules used by CCP internally
            "QA Damage Module"                         : False,
            "QA ECCM"                                  : False,
            "QA Immunity Module"                       : False,
            "QA Multiship Module - 10 Players"         : False,
            "QA Multiship Module - 20 Players"         : False,
            "QA Multiship Module - 40 Players"         : False,
            "QA Multiship Module - 5 Players"          : False,
            "QA Remote Armor Repair System - 5 Players": False,
            "QA Shield Transporter - 5 Players"        : False,
            "Goru's Shuttle"                           : False,
            "Guristas Shuttle"                         : False,
            "Mobile Decoy Unit"                        : False,  # Seems to be left over test mod for deployables
            "Tournament Micro Jump Unit"               : False,  # Normally seen only on tournament arenas
        }

        # do not publish ships that we convert
        for name in conversions.packs['skinnedShips']:
            self.ITEMS_FORCEPUBLISHED[name] = False

        if config.debug:
            # Publish Tactical Dessy Modes if in debug
            # Cannot use GROUPS_FORCEPUBLISHED as this does not force items
            # within group to be published, but rather for the group itself
            # to show up on ship list
            group = self.getGroup("Ship Modifiers", eager="items")
            for item in group.items:
                self.ITEMS_FORCEPUBLISHED[item.name] = True

        # List of groups which are forcibly published
        self.GROUPS_FORCEPUBLISHED = {
            "Prototype Exploration Ship": False
        }  # We moved the only ship from this group to other group anyway

        # Dictionary of items with forced meta groups, uses following format:
        # Item name: (metagroup name, parent type name)
        self.ITEMS_FORCEDMETAGROUP = {
            "'Habitat' Miner I"                        : ("Storyline", "Miner I"),
            "'Wild' Miner I"                           : ("Storyline", "Miner I"),
            "Medium Nano Armor Repair Unit I"          : ("Tech I", "Medium Armor Repairer I"),
            "Large 'Reprieve' Vestment Reconstructer I": ("Storyline", "Large Armor Repairer I"),
            "Khanid Navy Torpedo Launcher"             : ("Faction", "Torpedo Launcher I"),
        }
        # Parent type name: set(item names)
        self.ITEMS_FORCEDMETAGROUP_R = {}
        for item, value in list(self.ITEMS_FORCEDMETAGROUP.items()):
            parent = value[1]
            if parent not in self.ITEMS_FORCEDMETAGROUP_R:
                self.ITEMS_FORCEDMETAGROUP_R[parent] = set()
            self.ITEMS_FORCEDMETAGROUP_R[parent].add(item)
        # Dictionary of items with forced market group (service assumes they have no
        # market group assigned in db, otherwise they'll appear in both original and forced groups)
        self.ITEMS_FORCEDMARKETGROUP = {
            "Advanced Cerebral Accelerator"             : 977,  # Implants & Boosters > Booster
            "Civilian Damage Control"                   : 615,  # Ship Equipment > Hull & Armor > Damage Controls
            "Civilian EM Ward Field"                    : 1695,
            # Ship Equipment > Shield > Shield Hardeners > EM Shield Hardeners
            "Civilian Explosive Deflection Field"       : 1694,
            # Ship Equipment > Shield > Shield Hardeners > Explosive Shield Hardeners
            "Civilian Hobgoblin"                        : 837,  # Drones > Combat Drones > Light Scout Drones
            "Civilian Kinetic Deflection Field"         : 1693,
            # Ship Equipment > Shield > Shield Hardeners > Kinetic Shield Hardeners
            "Civilian Light Missile Launcher"           : 640,
            # Ship Equipment > Turrets & Bays > Missile Launchers > Light Missile Launchers
            "Civilian Scourge Light Missile"            : 920,
            # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles
            "Civilian Small Remote Armor Repairer"      : 1059,
            # Ship Equipment > Hull & Armor > Remote Armor Repairers > Small
            "Civilian Small Remote Shield Booster"      : 603,  # Ship Equipment > Shield > Remote Shield Boosters > Small
            "Civilian Stasis Webifier"                  : 683,  # Ship Equipment > Electronic Warfare > Stasis Webifiers
            "Civilian Warp Disruptor"                   : 1935,  # Ship Equipment > Electronic Warfare > Warp Disruptors
            "Hardwiring - Zainou 'Sharpshooter' ZMX10"  : 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX100" : 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1000": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX11"  : 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX110" : 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Hardwiring - Zainou 'Sharpshooter' ZMX1100": 1493,
            # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06
            "Nugoehuvi Synth Blue Pill Booster"         : 977,  # Implants & Boosters > Booster
            "Prototype Cerebral Accelerator"            : 977,  # Implants & Boosters > Booster
            "Prototype Iris Probe Launcher"             : 712,  # Ship Equipment > Turrets & Bays > Scan Probe Launchers
            "Shadow"                                    : 1310,  # Drones > Combat Drones > Fighter Bombers
            "Standard Cerebral Accelerator"             : 977,  # Implants & Boosters > Booster
        }

        self.ITEMS_FORCEDMARKETGROUP_R = self.__makeRevDict(self.ITEMS_FORCEDMARKETGROUP)

        self.FORCEDMARKETGROUP = {
            685: False,  # Ship Equipment > Electronic Warfare > ECCM
            681: False,  # Ship Equipment > Electronic Warfare > Sensor Backup Arrays
            1639: False  # Ship Equipment > Fleet Assistance > Command Processors
        }

        # Misc definitions
        # 0 is for items w/o meta group
        self.META_MAP = OrderedDict([("normal", frozenset((0, 1, 2, 14))),
                                     ("faction", frozenset((4, 3))),
                                     ("complex", frozenset((6,))),
                                     ("officer", frozenset((5,)))])
        self.SEARCH_CATEGORIES = (
            "Drone",
            "Module",
            "Subsystem",
            "Charge",
            "Implant",
            "Deployable",
            "Fighter",
            "Structure",
            "Structure Module",
        )
        self.SEARCH_GROUPS = ("Ice Product",)
        self.ROOT_MARKET_GROUPS = (9,  # Modules
                                   1111,  # Rigs
                                   157,  # Drones
                                   11,  # Ammo
                                   1112,  # Subsystems
                                   24,  # Implants & Boosters
                                   404,  # Deployables
                                   2202,  # Structure Equipment
                                   2203  # Structure Modifications
                                   )
        # Tell other threads that Market is at their service
        mktRdy.set()