From 9a137bb1584ed3081cfea91a8ed3f641b9ccc13e Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Wed, 8 Feb 2017 23:06:39 -0800 Subject: [PATCH] Convert old style classes to new --- eos/db/saveddata/databaseRepair.py | 22 ++- eos/db/saveddata/loadDefaultDatabaseValues.py | 2 +- eos/enum.py | 2 +- eos/modifiedAttributeDict.py | 4 +- gui/bitmapLoader.py | 2 +- gui/chromeTabs.py | 20 +- gui/commandView.py | 4 +- gui/projectedView.py | 4 +- gui/utils/exportHtml.py | 2 +- service/attribute.py | 2 +- service/crest.py | 18 +- service/damagePattern.py | 2 +- service/market.py | 183 +++++++++--------- service/network.py | 8 +- service/update.py | 2 +- utils/timer.py | 10 +- 16 files changed, 149 insertions(+), 138 deletions(-) diff --git a/eos/db/saveddata/databaseRepair.py b/eos/db/saveddata/databaseRepair.py index 185f8bed1..8061d524d 100644 --- a/eos/db/saveddata/databaseRepair.py +++ b/eos/db/saveddata/databaseRepair.py @@ -23,7 +23,7 @@ import logging logger = logging.getLogger(__name__) -class DatabaseCleanup: +class DatabaseCleanup(object): def __init__(self): pass @@ -86,7 +86,8 @@ class DatabaseCleanup: else: uniform_damage_pattern_id = rows[0]['ID'] update_query = "UPDATE 'fits' SET 'damagePatternID' = {} " \ - "WHERE damagePatternID NOT IN (SELECT ID FROM damagePatterns) OR damagePatternID IS NULL".format(uniform_damage_pattern_id) + "WHERE damagePatternID NOT IN (SELECT ID FROM damagePatterns) OR damagePatternID IS NULL".format( + uniform_damage_pattern_id) update_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, update_query) logger.error("Database corruption found. Cleaning up %d records.", update_results.rowcount) @@ -118,7 +119,7 @@ class DatabaseCleanup: logger.error("More than one 'All 5' character found.") else: all5_id = rows[0]['ID'] - update_query = "UPDATE 'fits' SET 'characterID' = " + str(all5_id) + \ + update_query = "UPDATE 'fits' SET 'characterID' = " + str(all5_id) + \ " WHERE characterID not in (select ID from characters) OR characterID IS NULL" update_results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, update_query) logger.error("Database corruption found. Cleaning up %d records.", update_results.rowcount) @@ -167,7 +168,8 @@ class DatabaseCleanup: # See issue #954 for table in ['drones', 'cargo', 'fighters']: logger.debug("Running database cleanup for orphaned %s items.", table) - query = "SELECT COUNT(*) AS num FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(table) + query = "SELECT COUNT(*) AS num FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format( + table) results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query) if results is None: @@ -176,13 +178,15 @@ class DatabaseCleanup: row = results.first() if row and row['num']: - query = "DELETE FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(table) + query = "DELETE FROM {} WHERE itemID IS NULL OR itemID = '' or itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format( + table) delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query) logger.error("Database corruption found. Cleaning up %d records.", delete.rowcount) for table in ['modules']: logger.debug("Running database cleanup for orphaned %s items.", table) - query = "SELECT COUNT(*) AS num FROM {} WHERE itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format(table) + query = "SELECT COUNT(*) AS num FROM {} WHERE itemID = '0' or fitID IS NULL OR fitID = '' or fitID = '0'".format( + table) results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query) if results is None: @@ -202,7 +206,8 @@ class DatabaseCleanup: for profileType in ['damagePatterns', 'targetResists']: for damageType in ['em', 'thermal', 'kinetic', 'explosive']: logger.debug("Running database cleanup for null %s values. (%s)", profileType, damageType) - query = "SELECT COUNT(*) AS num FROM {0} WHERE {1}Amount IS NULL OR {1}Amount = ''".format(profileType, damageType) + query = "SELECT COUNT(*) AS num FROM {0} WHERE {1}Amount IS NULL OR {1}Amount = ''".format(profileType, + damageType) results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query) if results is None: @@ -211,7 +216,8 @@ class DatabaseCleanup: row = results.first() if row and row['num']: - query = "UPDATE '{0}' SET '{1}Amount' = '0' WHERE {1}Amount IS NULL OR Amount = ''".format(profileType, damageType) + query = "UPDATE '{0}' SET '{1}Amount' = '0' WHERE {1}Amount IS NULL OR Amount = ''".format(profileType, + damageType) delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query) logger.error("Database corruption found. Cleaning up %d records.", delete.rowcount) diff --git a/eos/db/saveddata/loadDefaultDatabaseValues.py b/eos/db/saveddata/loadDefaultDatabaseValues.py index 29534bc5e..befaad44b 100644 --- a/eos/db/saveddata/loadDefaultDatabaseValues.py +++ b/eos/db/saveddata/loadDefaultDatabaseValues.py @@ -26,7 +26,7 @@ class ImportError(Exception): pass -class DefaultDatabaseValues(): +class DefaultDatabaseValues(object): def __init__(self): pass diff --git a/eos/enum.py b/eos/enum.py index 04caea536..12e8e09e1 100644 --- a/eos/enum.py +++ b/eos/enum.py @@ -1,4 +1,4 @@ -class Enum(): +class Enum(object): def __init__(self): pass diff --git a/eos/modifiedAttributeDict.py b/eos/modifiedAttributeDict.py index e558dc64d..c09b8f59a 100644 --- a/eos/modifiedAttributeDict.py +++ b/eos/modifiedAttributeDict.py @@ -43,7 +43,7 @@ class ChargeAttrShortcut(object): class ModifiedAttributeDict(collections.MutableMapping): OVERRIDES = False - class CalculationPlaceholder(): + class CalculationPlaceholder(object): def __init__(self): pass @@ -359,7 +359,7 @@ class ModifiedAttributeDict(collections.MutableMapping): self.__afflict(attributeName, u"\u2263", value) -class Affliction(): +class Affliction(object): def __init__(self, type, amount): self.type = type self.amount = amount diff --git a/gui/bitmapLoader.py b/gui/bitmapLoader.py index c6c932b4b..cb47e24bd 100644 --- a/gui/bitmapLoader.py +++ b/gui/bitmapLoader.py @@ -33,7 +33,7 @@ except ImportError: from utils.compat import OrderedDict -class BitmapLoader(): +class BitmapLoader(object): try: archive = zipfile.ZipFile(config.getPyfaPath('imgs.zip'), 'r') except IOError: diff --git a/gui/chromeTabs.py b/gui/chromeTabs.py index f5033baf3..600a49950 100644 --- a/gui/chromeTabs.py +++ b/gui/chromeTabs.py @@ -36,7 +36,7 @@ PageAdded, EVT_NOTEBOOK_PAGE_ADDED = wx.lib.newevent.NewEvent() PageClosed, EVT_NOTEBOOK_PAGE_CLOSED = wx.lib.newevent.NewEvent() -class VetoAble(): +class VetoAble(object): def __init__(self): self.__vetoed = False @@ -47,7 +47,7 @@ class VetoAble(): return self.__vetoed -class NotebookTabChangeEvent(): +class NotebookTabChangeEvent(object): def __init__(self, old, new): self.__old = old self.__new = new @@ -337,7 +337,7 @@ class PFNotebook(wx.Panel): event.Skip() -class PFTabRenderer: +class PFTabRenderer(object): def __init__(self, size=(36, 24), text=wx.EmptyString, img=None, inclination=6, closeButton=True): """ Renders a new tab @@ -529,8 +529,8 @@ class PFTabRenderer: self.tabRegion = wx.RegionFromBitmap(self.tabBackBitmap) self.closeBtnRegion = wx.RegionFromBitmap(self.ctabCloseBmp) self.closeBtnRegion.Offset( - self.contentWidth + self.leftWidth - self.ctabCloseBmp.GetWidth() / 2, - (self.tabHeight - self.ctabCloseBmp.GetHeight()) / 2 + self.contentWidth + self.leftWidth - self.ctabCloseBmp.GetWidth() / 2, + (self.tabHeight - self.ctabCloseBmp.GetHeight()) / 2 ) def InitColors(self): @@ -593,9 +593,9 @@ class PFTabRenderer: cbmp = wx.BitmapFromImage(cimg) mdc.DrawBitmap( - cbmp, - self.contentWidth + self.leftWidth - self.ctabCloseBmp.GetWidth() / 2, - (height - self.ctabCloseBmp.GetHeight()) / 2, + cbmp, + self.contentWidth + self.leftWidth - self.ctabCloseBmp.GetWidth() / 2, + (height - self.ctabCloseBmp.GetHeight()) / 2, ) mdc.SelectObject(wx.NullBitmap) @@ -611,11 +611,11 @@ class PFTabRenderer: def __repr__(self): return "PFTabRenderer(text={}, disabled={}) at {}".format( - self.text, self.disabled, hex(id(self)) + self.text, self.disabled, hex(id(self)) ) -class PFAddRenderer: +class PFAddRenderer(object): def __init__(self): """Renders the add tab button""" self.addImg = BitmapLoader.getImage("ctabadd", "gui") diff --git a/gui/commandView.py b/gui/commandView.py index 4a3850f19..9ec44dcb9 100644 --- a/gui/commandView.py +++ b/gui/commandView.py @@ -29,13 +29,13 @@ from service.fit import Fit from eos.saveddata.drone import Drone as es_Drone -class DummyItem: +class DummyItem(object): def __init__(self, txt): self.name = txt self.icon = None -class DummyEntry: +class DummyEntry(object): def __init__(self, txt): self.item = DummyItem(txt) diff --git a/gui/projectedView.py b/gui/projectedView.py index bfd5736ea..da96734e5 100644 --- a/gui/projectedView.py +++ b/gui/projectedView.py @@ -31,13 +31,13 @@ from eos.saveddata.fighter import Fighter as es_Fighter from eos.saveddata.module import Module as es_Module -class DummyItem: +class DummyItem(object): def __init__(self, txt): self.name = txt self.icon = None -class DummyEntry: +class DummyEntry(object): def __init__(self, txt): self.item = DummyItem(txt) diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index 5cdec552f..023d18cce 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -7,7 +7,7 @@ from service.fit import Fit from service.market import Market -class exportHtml(): +class exportHtml(object): _instance = None @classmethod diff --git a/service/attribute.py b/service/attribute.py index ee4f43328..68b998f07 100644 --- a/service/attribute.py +++ b/service/attribute.py @@ -20,7 +20,7 @@ import eos.db -class Attribute(): +class Attribute(object): instance = None @classmethod diff --git a/service/crest.py b/service/crest.py index e672e3df6..39863fb31 100644 --- a/service/crest.py +++ b/service/crest.py @@ -28,9 +28,9 @@ class CrestModes(Enum): USER = 1 -class Crest(): +class Crest(object): clientIDs = { - Servers.TQ: 'f9be379951c046339dc13a00e6be7704', + Servers.TQ : 'f9be379951c046339dc13a00e6be7704', Servers.SISI: 'af87365240d644f7950af563b8418bad' } @@ -78,11 +78,11 @@ class Crest(): # Base EVE connection that is copied to all characters self.eve = EVE( - client_id=self.settings.get('clientID') if self.settings.get( - 'mode') == CrestModes.USER else self.clientIDs.get(self.settings.get('server')), - api_key=self.settings.get('clientSecret') if self.settings.get('mode') == CrestModes.USER else None, - redirect_uri=self.clientCallback, - testing=self.isTestServer + client_id=self.settings.get('clientID') if self.settings.get( + 'mode') == CrestModes.USER else self.clientIDs.get(self.settings.get('server')), + api_key=self.settings.get('clientSecret') if self.settings.get('mode') == CrestModes.USER else None, + redirect_uri=self.clientCallback, + testing=self.isTestServer ) self.implicitCharacter = None @@ -187,8 +187,8 @@ class Crest(): if 'access_token' in message: # implicit eve = copy.deepcopy(self.eve) eve.temptoken_authorize( - access_token=message['access_token'][0], - expires_in=int(message['expires_in'][0]) + access_token=message['access_token'][0], + expires_in=int(message['expires_in'][0]) ) self.ssoTimer = threading.Timer(int(message['expires_in'][0]), self.logout) self.ssoTimer.start() diff --git a/service/damagePattern.py b/service/damagePattern.py index 2343693d3..21536e53e 100644 --- a/service/damagePattern.py +++ b/service/damagePattern.py @@ -27,7 +27,7 @@ class ImportError(Exception): pass -class DamagePattern(): +class DamagePattern(object): instance = None @classmethod diff --git a/service/market.py b/service/market.py index 074e9618a..e5bc16117 100644 --- a/service/market.py +++ b/service/market.py @@ -169,7 +169,7 @@ class SearchWorkerThread(threading.Thread): self.cv.release() -class Market(): +class Market(object): instance = None def __init__(self): @@ -179,7 +179,7 @@ class Market(): serviceMarketRecentlyUsedModules = {"pyfaMarketRecentlyUsedModules": []} self.serviceMarketRecentlyUsedModules = SettingsProvider.getInstance().getSettings( - "pyfaMarketRecentlyUsedModules", serviceMarketRecentlyUsedModules) + "pyfaMarketRecentlyUsedModules", serviceMarketRecentlyUsedModules) # Start price fetcher self.priceWorkerThread = PriceWorkerThread() @@ -209,41 +209,41 @@ class Market(): self.les_grp.description = "" self.les_grp.icon = None self.ITEMS_FORCEGROUP = { - "Opux Luxury Yacht": self.les_grp, + "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 - "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 + "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 + "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 + "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) @@ -252,26 +252,26 @@ class Market(): # 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, + "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 - "Council Diplomatic Shuttle": False, # CSM X celebration - "Civilian Gatling Railgun": True, - "Civilian Gatling Pulse Laser": True, - "Civilian Gatling Autocannon": True, - "Civilian Light Electron Blaster": True, + "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 + "Council Diplomatic Shuttle" : False, # CSM X celebration + "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 @@ -289,16 +289,18 @@ class Market(): # 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 + "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"), + "'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"), } + "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(): @@ -309,57 +311,58 @@ class Market(): # 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, + "'Alpha' Data Analyzer I" : 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners - "'Codex' Data Analyzer I": 714, + "'Codex' Data Analyzer I" : 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners - "'Daemon' Data Analyzer I": 714, + "'Daemon' Data Analyzer I" : 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners - "'Libram' Data Analyzer I": 714, + "'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, + "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, + "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, + "Civilian Light Missile Launcher" : 640, # Ship Equipment > Turrets & Bays > Missile Launchers > Light Missile Launchers - "Civilian Scourge Light Missile": 920, + "Civilian Scourge Light Missile" : 920, # Ammunition & Charges > Missiles > Light Missiles > Standard Light Missiles - "Civilian Small Remote Armor Repairer": 1059, + "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, + "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, + "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, + "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, + "Hardwiring - Zainou 'Sharpshooter' ZMX11" : 1493, # Implants & Boosters > Implants > Skill Hardwiring > Missile Implants > Implant Slot 06 - "Hardwiring - Zainou 'Sharpshooter' ZMX110": 1493, + "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, + "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, + "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, + "Terran Data Analyzer I" : 714, # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners - "Tetrimon Data Analyzer I": 714 + "Tetrimon Data Analyzer I" : 714 # Ship Equipment > Electronics and Sensor Upgrades > Scanners > Data and Composition Scanners } @@ -617,7 +620,7 @@ class Market(): if hasattr(group, 'addItems'): groupItems.update(group.addItems) items = set( - filter(lambda item: self.getPublicityByItem(item) and self.getGroupByItem(item) == group, groupItems)) + filter(lambda item: self.getPublicityByItem(item) and self.getGroupByItem(item) == group, groupItems)) return items def getItemsByMarketGroup(self, mg, vars_=True): diff --git a/service/network.py b/service/network.py index 481c77a41..d050e88e2 100644 --- a/service/network.py +++ b/service/network.py @@ -51,7 +51,7 @@ class TimeoutError(StandardError): pass -class Network(): +class Network(object): # Request constants - every request must supply this, as it is checked if # enabled or not via settings ENABLED = 1 @@ -90,8 +90,10 @@ class Network(): # proxy_auth is a tuple of (login, password) or None if proxy_auth is not None: # add login:password@ in front of proxy address - proxy_handler = urllib2.ProxyHandler({'https': '{0}:{1}@{2}:{3}'.format( - proxy_auth[0], proxy_auth[1], proxy[0], proxy[1])}) + proxy_handler = urllib2.ProxyHandler({ + 'https': '{0}:{1}@{2}:{3}'.format( + proxy_auth[0], proxy_auth[1], proxy[0], proxy[1]) + }) else: # build proxy handler with no login/pass info proxy_handler = urllib2.ProxyHandler({'https': "{0}:{1}".format(proxy[0], proxy[1])}) diff --git a/service/update.py b/service/update.py index 6ca8a61a8..cbbc4867f 100644 --- a/service/update.py +++ b/service/update.py @@ -89,7 +89,7 @@ class CheckUpdateThread(threading.Thread): return tuple(map(int, (v.split(".")))) -class Update(): +class Update(object): instance = None def CheckUpdate(self, callback): diff --git a/utils/timer.py b/utils/timer.py index 41b5f78b7..8139f9101 100644 --- a/utils/timer.py +++ b/utils/timer.py @@ -1,7 +1,7 @@ import time -class Timer(): +class Timer(object): def __init__(self, name='', logger=None): self.name = name self.start = time.time() @@ -18,10 +18,10 @@ class Timer(): def checkpoint(self, name=''): text = u'Timer - {timer} - {checkpoint} - {last:.2f}ms ({elapsed:.2f}ms elapsed)'.format( - timer=self.name, - checkpoint=unicode(name, "utf-8"), - last=self.last, - elapsed=self.elapsed + timer=self.name, + checkpoint=unicode(name, "utf-8"), + last=self.last, + elapsed=self.elapsed ).strip() self.__last = time.time() if self.logger: