diff --git a/config.py b/config.py index ff79be839a..8041ff2bca 100644 --- a/config.py +++ b/config.py @@ -233,7 +233,7 @@ def defLogging(): ]) -class LoggerWriter(object): +class LoggerWriter: def __init__(self, level): # self.level is really like using log.debug(message) # at least in my case diff --git a/eos/capSim.py b/eos/capSim.py index 8b16c3e0f0..1a99a9c193 100644 --- a/eos/capSim.py +++ b/eos/capSim.py @@ -13,7 +13,7 @@ def lcm(a, b): return n / a -class CapSimulator(object): +class CapSimulator: """Entity's EVE Capacitor Simulator""" def __init__(self): diff --git a/eos/db/saveddata/databaseRepair.py b/eos/db/saveddata/databaseRepair.py index e40a022f07..79aab91bfe 100644 --- a/eos/db/saveddata/databaseRepair.py +++ b/eos/db/saveddata/databaseRepair.py @@ -23,7 +23,7 @@ pyfalog = Logger(__name__) -class DatabaseCleanup(object): +class DatabaseCleanup: def __init__(self): pass diff --git a/eos/db/saveddata/fit.py b/eos/db/saveddata/fit.py index 274c50b23c..57426815f2 100644 --- a/eos/db/saveddata/fit.py +++ b/eos/db/saveddata/fit.py @@ -82,7 +82,7 @@ ) -class ProjectedFit(object): +class ProjectedFit: def __init__(self, sourceID, source_fit, amount=1, active=True): self.sourceID = sourceID self.source_fit = source_fit @@ -113,7 +113,7 @@ def __repr__(self): ) -class CommandFit(object): +class CommandFit: def __init__(self, boosterID, booster_fit, active=True): self.boosterID = boosterID self.booster_fit = booster_fit diff --git a/eos/db/saveddata/loadDefaultDatabaseValues.py b/eos/db/saveddata/loadDefaultDatabaseValues.py index 1fcbd3abac..f329ab2d64 100644 --- a/eos/db/saveddata/loadDefaultDatabaseValues.py +++ b/eos/db/saveddata/loadDefaultDatabaseValues.py @@ -26,7 +26,7 @@ class ImportError(Exception): pass -class DefaultDatabaseValues(object): +class DefaultDatabaseValues: def __init__(self): pass diff --git a/eos/effectHandlerHelpers.py b/eos/effectHandlerHelpers.py index 81cd07f190..3844f21dd5 100644 --- a/eos/effectHandlerHelpers.py +++ b/eos/effectHandlerHelpers.py @@ -394,7 +394,7 @@ def insert(self, idx, proj): proj.projected = False -class HandledItem(object): +class HandledItem: def preAssignItemAttr(self, *args, **kwargs): self.itemModifiedAttributes.preAssign(*args, **kwargs) @@ -411,7 +411,7 @@ def forceItemAttr(self, *args, **kwargs): self.itemModifiedAttributes.force(*args, **kwargs) -class HandledCharge(object): +class HandledCharge: def preAssignChargeAttr(self, *args, **kwargs): self.chargeModifiedAttributes.preAssign(*args, **kwargs) diff --git a/eos/eqBase.py b/eos/eqBase.py index 73462c5ae2..a81add9926 100644 --- a/eos/eqBase.py +++ b/eos/eqBase.py @@ -18,7 +18,7 @@ # =============================================================================== -class EqBase(object): +class EqBase: ID = None def __eq__(self, other): diff --git a/eos/modifiedAttributeDict.py b/eos/modifiedAttributeDict.py index 18f9adff85..f73ef08e44 100644 --- a/eos/modifiedAttributeDict.py +++ b/eos/modifiedAttributeDict.py @@ -27,7 +27,7 @@ cappingAttrKeyCache = {} -class ItemAttrShortcut(object): +class ItemAttrShortcut: def getModifiedItemAttr(self, key, default=0): return_value = self.itemModifiedAttributes.get(key) @@ -50,7 +50,7 @@ def getChargeBaseAttrValue(self, key, default=0): return return_value or default -class ChargeAttrShortcut(object): +class ChargeAttrShortcut: def getModifiedChargeAttr(self, key, default=0): return_value = self.chargeModifiedAttributes.get(key) @@ -60,7 +60,7 @@ def getModifiedChargeAttr(self, key, default=0): class ModifiedAttributeDict(collections.MutableMapping): overrides_enabled = False - class CalculationPlaceholder(object): + class CalculationPlaceholder: def __init__(self): pass @@ -441,7 +441,7 @@ def getResistance(fit, effect): return resist or 1.0 -class Affliction(object): +class Affliction: def __init__(self, affliction_type, amount): self.type = affliction_type self.amount = amount diff --git a/eos/saveddata/boosterSideEffect.py b/eos/saveddata/boosterSideEffect.py index 32c467232f..5b468c91c4 100644 --- a/eos/saveddata/boosterSideEffect.py +++ b/eos/saveddata/boosterSideEffect.py @@ -24,7 +24,7 @@ pyfalog = Logger(__name__) -class BoosterSideEffect(object): +class BoosterSideEffect: def __init__(self, effect): """Initialize from the program""" diff --git a/eos/saveddata/character.py b/eos/saveddata/character.py index f05b74b2cb..6c306e46c2 100644 --- a/eos/saveddata/character.py +++ b/eos/saveddata/character.py @@ -32,7 +32,7 @@ pyfalog = Logger(__name__) -class Character(object): +class Character: __itemList = None __itemIDMap = None __itemNameMap = None diff --git a/eos/saveddata/damagePattern.py b/eos/saveddata/damagePattern.py index 30015e7158..f518be1270 100644 --- a/eos/saveddata/damagePattern.py +++ b/eos/saveddata/damagePattern.py @@ -21,7 +21,7 @@ import eos.db -class DamagePattern(object): +class DamagePattern: DAMAGE_TYPES = ("em", "thermal", "kinetic", "explosive") def __init__(self, *args, **kwargs): diff --git a/eos/saveddata/fighterAbility.py b/eos/saveddata/fighterAbility.py index d1f4d0020f..bcc01b2a6a 100644 --- a/eos/saveddata/fighterAbility.py +++ b/eos/saveddata/fighterAbility.py @@ -26,7 +26,7 @@ pyfalog = Logger(__name__) -class FighterAbility(object): +class FighterAbility: # We aren't able to get data on the charges that can be stored with fighters. So we hardcode that data here, keyed # with the fighter squadron role diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index 6a4442dd8f..b27bf1b4c1 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -42,7 +42,7 @@ pyfalog = Logger(__name__) -class Fit(object): +class Fit: """Represents a fitting, with modules, ship, implants, etc.""" PEAK_RECHARGE = 0.25 diff --git a/eos/saveddata/implantSet.py b/eos/saveddata/implantSet.py index 8b996e183d..1ae07d37f9 100644 --- a/eos/saveddata/implantSet.py +++ b/eos/saveddata/implantSet.py @@ -22,7 +22,7 @@ from eos.effectHandlerHelpers import HandledImplantList -class ImplantSet(object): +class ImplantSet: def __init__(self, name=None): self.name = name self.__implants = HandledImplantList() diff --git a/eos/saveddata/price.py b/eos/saveddata/price.py index 0a2a7ce9d9..7fe5d1d9bd 100644 --- a/eos/saveddata/price.py +++ b/eos/saveddata/price.py @@ -42,7 +42,7 @@ class PriceStatus(IntEnum): fetchTimeout = 4 -class Price(object): +class Price: def __init__(self, typeID): self.typeID = typeID self.time = 0 diff --git a/eos/saveddata/ssocharacter.py b/eos/saveddata/ssocharacter.py index 04b57bdc9d..49b742442c 100644 --- a/eos/saveddata/ssocharacter.py +++ b/eos/saveddata/ssocharacter.py @@ -24,7 +24,7 @@ # from tomorrow import threads -class SsoCharacter(object): +class SsoCharacter: def __init__(self, charID, name, client, accessToken=None, refreshToken=None): self.characterID = charID self.characterName = name diff --git a/eos/saveddata/targetResists.py b/eos/saveddata/targetResists.py index 63b64afef4..7d1f2956e9 100644 --- a/eos/saveddata/targetResists.py +++ b/eos/saveddata/targetResists.py @@ -24,7 +24,7 @@ pyfalog = Logger(__name__) -class TargetResists(object): +class TargetResists: # also determined import/export order - VERY IMPORTANT DAMAGE_TYPES = ("em", "thermal", "kinetic", "explosive") diff --git a/eos/saveddata/user.py b/eos/saveddata/user.py index b623452dbc..d21e0af7bd 100644 --- a/eos/saveddata/user.py +++ b/eos/saveddata/user.py @@ -24,7 +24,7 @@ from sqlalchemy.orm import validates -class User(object): +class User: def __init__(self, username, password=None, admin=False): self.username = username if password is not None: diff --git a/gui/bitmap_loader.py b/gui/bitmap_loader.py index bbc31bbb23..66bd7e98b4 100644 --- a/gui/bitmap_loader.py +++ b/gui/bitmap_loader.py @@ -31,7 +31,7 @@ pyfalog = Logger(__name__) -class BitmapLoader(object): +class BitmapLoader: # try: # archive = zipfile.ZipFile(os.path.join(config.pyfaPath, 'imgs.zip'), 'r') # logging.info("Using zipped image files.") diff --git a/gui/builtinAdditionPanes/projectedView.py b/gui/builtinAdditionPanes/projectedView.py index 2a7adf4408..d955158892 100644 --- a/gui/builtinAdditionPanes/projectedView.py +++ b/gui/builtinAdditionPanes/projectedView.py @@ -42,13 +42,13 @@ pyfalog = Logger(__name__) -class DummyItem(object): +class DummyItem: def __init__(self, txt): self.name = txt self.iconID = None -class DummyEntry(object): +class DummyEntry: def __init__(self, txt): self.item = DummyItem(txt) diff --git a/gui/builtinShipBrowser/sfBrowserItem.py b/gui/builtinShipBrowser/sfBrowserItem.py index bb30a040ba..02fe032189 100644 --- a/gui/builtinShipBrowser/sfBrowserItem.py +++ b/gui/builtinShipBrowser/sfBrowserItem.py @@ -14,7 +14,7 @@ BTN_DISABLED = 8 -class PFBaseButton(object): +class PFBaseButton: def __init__(self, normalBitmap=wx.NullBitmap, label="", callback=None, hoverBitmap=None, disabledBitmap=None, show=True): @@ -85,7 +85,7 @@ def GetDropShadowBitmap(self): return self.dropShadowBmp -class PFToolbar(object): +class PFToolbar: def __init__(self, parent): self.Parent = parent self.buttons = [] diff --git a/gui/errorDialog.py b/gui/errorDialog.py index 240ab8da40..de49e1abbc 100644 --- a/gui/errorDialog.py +++ b/gui/errorDialog.py @@ -31,7 +31,7 @@ pyfalog = Logger(__name__) -class ErrorHandler(object): +class ErrorHandler: __parent = None __frame = None diff --git a/gui/esiFittings.py b/gui/esiFittings.py index 60a1a98127..8f363f416f 100644 --- a/gui/esiFittings.py +++ b/gui/esiFittings.py @@ -172,7 +172,7 @@ def deleteFitting(self, event): self.statusbar.SetStatusText(msg) -class ESIServerExceptionHandler(object): +class ESIServerExceptionHandler: def __init__(self, parentWindow, ex): dlg = wx.MessageDialog(parentWindow, "There was an issue starting up the localized server, try setting " @@ -185,7 +185,7 @@ def __init__(self, parentWindow, ex): pyfalog.error(ex) -class ESIExceptionHandler(object): +class ESIExceptionHandler: # todo: make this a generate excetpion handler for all calls def __init__(self, parentWindow, ex): if ex.response['error'].startswith('Token is not valid') or ex.response['error'] == 'invalid_token': # todo: this seems messy, figure out a better response diff --git a/gui/graphFrame/frame.py b/gui/graphFrame/frame.py index 064f067b12..f96b554e9e 100644 --- a/gui/graphFrame/frame.py +++ b/gui/graphFrame/frame.py @@ -31,6 +31,7 @@ import gui.mainFrame from gui.bitmap_loader import BitmapLoader from gui.builtinGraphs.base import FitGraph +from gui.builtinShipBrowser.events import EVT_FIT_RENAMED from service.const import GraphCacheCleanupReason from service.settings import GraphSettings from .panel import GraphControlPanel @@ -123,6 +124,7 @@ def __init__(self, parent, style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_ self.Bind(wx.EVT_CHAR_HOOK, self.kbEvent) # Event bindings - external events self.mainFrame.Bind(GE.FIT_CHANGED, self.OnFitChanged) + self.mainFrame.Bind(EVT_FIT_RENAMED, self.OnFitRenamed) self.mainFrame.Bind(GE.GRAPH_OPTION_CHANGED, self.OnGraphOptionChanged) self.Layout() @@ -156,6 +158,10 @@ def OnFitChanged(self, event): self.clearCache(reason=GraphCacheCleanupReason.fitChanged, extraData=event.fitID) self.draw() + def OnFitRenamed(self, event): + event.Skip() + self.draw() + def OnGraphOptionChanged(self, event): event.Skip() self.clearCache(reason=GraphCacheCleanupReason.optionChanged) @@ -171,6 +177,7 @@ def OnGraphSwitched(self, event): def closeWindow(self): self.mainFrame.Unbind(GE.FIT_CHANGED, handler=self.OnFitChanged) + self.mainFrame.Unbind(EVT_FIT_RENAMED, handler=self.OnFitRenamed) self.mainFrame.Unbind(GE.GRAPH_OPTION_CHANGED, handler=self.OnGraphOptionChanged) self.ctrlPanel.unbindExternalEvents() self.Destroy() diff --git a/gui/graphFrame/lists.py b/gui/graphFrame/lists.py index a9b3ba340a..a306fdf97b 100644 --- a/gui/graphFrame/lists.py +++ b/gui/graphFrame/lists.py @@ -23,6 +23,7 @@ import gui.display import gui.globalEvents as GE +from gui.builtinShipBrowser.events import EVT_FIT_RENAMED from service.fit import Fit @@ -46,6 +47,7 @@ def __init__(self, graphFrame, parent): self.contextMenu.Bind(wx.EVT_MENU, self.ContextMenuHandler, removeItem) self.graphFrame.mainFrame.Bind(GE.FIT_REMOVED, self.OnFitRemoved) + self.graphFrame.mainFrame.Bind(EVT_FIT_RENAMED, self.OnFitRenamed) self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick) self.Bind(wx.EVT_CHAR_HOOK, self.kbEvent) self.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu) @@ -85,6 +87,10 @@ def OnFitRemoved(self, event): if fit is not None: self.removeFits([fit]) + def OnFitRenamed(self, event): + event.Skip() + self.update(self.fits) + def getSelectedFits(self): fits = [] for row in self.getSelectedRows(): @@ -108,6 +114,7 @@ def removeFits(self, fits): def unbindExternalEvents(self): self.graphFrame.mainFrame.Unbind(GE.FIT_REMOVED, handler=self.OnFitRemoved) + self.graphFrame.mainFrame.Unbind(EVT_FIT_RENAMED, handler=self.OnFitRenamed) def handleDrag(self, type, fitID): if type == 'fit': diff --git a/gui/multiSwitch.py b/gui/multiSwitch.py index d6103d1041..cae62f6951 100644 --- a/gui/multiSwitch.py +++ b/gui/multiSwitch.py @@ -47,7 +47,7 @@ def DeletePage(self, n, *args, **kwargs): if self.GetPageCount() == 0: self.AddPage() -class TabSpawner(object): +class TabSpawner: tabTypes = [] @classmethod diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index ab8fa91076..10df1947d0 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -13,7 +13,7 @@ pyfalog = Logger(__name__) -class exportHtml(object): +class exportHtml: _instance = None @classmethod diff --git a/gui/viewColumn.py b/gui/viewColumn.py index 08f9ca2bb2..c992b9c7d4 100644 --- a/gui/viewColumn.py +++ b/gui/viewColumn.py @@ -21,7 +21,7 @@ import wx -class ViewColumn(object): +class ViewColumn: """ Abstract class that columns can inherit from. Once the missing methods are correctly implemented, diff --git a/service/attribute.py b/service/attribute.py index b5ebcae662..e6cca97637 100644 --- a/service/attribute.py +++ b/service/attribute.py @@ -20,7 +20,7 @@ import eos.db -class Attribute(object): +class Attribute: instance = None @classmethod diff --git a/service/character.py b/service/character.py index b5e7d1e6e9..e750cb7f6a 100644 --- a/service/character.py +++ b/service/character.py @@ -122,7 +122,7 @@ def run(self): wx.CallAfter(self.callback) -class Character(object): +class Character: instance = None skillReqsDict = {} diff --git a/service/damagePattern.py b/service/damagePattern.py index fd2d2c6b6a..83a77f58b5 100644 --- a/service/damagePattern.py +++ b/service/damagePattern.py @@ -27,7 +27,7 @@ class ImportError(Exception): pass -class DamagePattern(object): +class DamagePattern: instance = None @classmethod diff --git a/service/esiAccess.py b/service/esiAccess.py index d89fc9b0bf..f3495266be 100644 --- a/service/esiAccess.py +++ b/service/esiAccess.py @@ -61,7 +61,7 @@ def __str__(self): return 'HTTP Error %s' % self.status_code -class EsiAccess(object): +class EsiAccess: def __init__(self): self.settings = EsiSettings.getInstance() diff --git a/service/implantSet.py b/service/implantSet.py index b3440de6bc..99737c80ce 100644 --- a/service/implantSet.py +++ b/service/implantSet.py @@ -29,7 +29,7 @@ class ImportError(Exception): pass -class ImplantSets(object): +class ImplantSets: instance = None @classmethod diff --git a/service/jargon/jargon.py b/service/jargon/jargon.py index 3530d08593..95d3ae7f4e 100644 --- a/service/jargon/jargon.py +++ b/service/jargon/jargon.py @@ -18,7 +18,7 @@ # ============================================================================= -class Jargon(object): +class Jargon: def __init__(self, rawdata: dict): self._rawdata = rawdata diff --git a/service/jargon/loader.py b/service/jargon/loader.py index f0eb8f05b3..5374a59140 100644 --- a/service/jargon/loader.py +++ b/service/jargon/loader.py @@ -27,7 +27,7 @@ JARGON_PATH = os.path.join(config.savePath, 'jargon.yaml') -class JargonLoader(object): +class JargonLoader: def __init__(self, jargon_path: str): self.jargon_path = jargon_path self._jargon_mtime = 0 # type: int diff --git a/service/market.py b/service/market.py index 729a3e68c0..f5394948f6 100644 --- a/service/market.py +++ b/service/market.py @@ -140,7 +140,7 @@ def scheduleSearch(self, text, callback, filterOn=True): self.cv.release() -class Market(object): +class Market: instance = None def __init__(self): diff --git a/service/port/port.py b/service/port/port.py index 60ab29663c..d1468b9fbc 100644 --- a/service/port/port.py +++ b/service/port/port.py @@ -46,7 +46,7 @@ RE_XML_START = r'<\?xml\s+version="1.0"\s*\?>' -class Port(object): +class Port: """Service which houses all import/export format functions""" instance = None __tag_replace_flag = True diff --git a/service/targetResists.py b/service/targetResists.py index ca4ed57e7b..fe907f14b9 100644 --- a/service/targetResists.py +++ b/service/targetResists.py @@ -27,7 +27,7 @@ class ImportError(Exception): pass -class TargetResists(object): +class TargetResists: instance = None @classmethod diff --git a/service/update.py b/service/update.py index 5adff00446..2560e6fce1 100644 --- a/service/update.py +++ b/service/update.py @@ -91,7 +91,7 @@ def versiontuple(v): return tuple(map(int, (v.split(".")))) -class Update(object): +class Update: instance = None @staticmethod diff --git a/utils/stopwatch.py b/utils/stopwatch.py index cb5f0b9ea9..b65dd6edc5 100644 --- a/utils/stopwatch.py +++ b/utils/stopwatch.py @@ -4,7 +4,7 @@ import os -class Stopwatch(object): +class Stopwatch: """ --- on python console --- import re diff --git a/utils/timer.py b/utils/timer.py index da7042f59c..0058506a22 100644 --- a/utils/timer.py +++ b/utils/timer.py @@ -1,7 +1,7 @@ import time -class Timer(object): +class Timer: def __init__(self, name='', logger=None): self.name = name self.start = time.time()