Skip to content

Commit

Permalink
Update graph info when fit name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkFenX committed Jul 6, 2019
1 parent 3e41054 commit 5b74c6c
Show file tree
Hide file tree
Showing 41 changed files with 61 additions and 47 deletions.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eos/capSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def lcm(a, b):
return n / a


class CapSimulator(object):
class CapSimulator:
"""Entity's EVE Capacitor Simulator"""

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion eos/db/saveddata/databaseRepair.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
pyfalog = Logger(__name__)


class DatabaseCleanup(object):
class DatabaseCleanup:
def __init__(self):
pass

Expand Down
4 changes: 2 additions & 2 deletions eos/db/saveddata/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eos/db/saveddata/loadDefaultDatabaseValues.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ImportError(Exception):
pass


class DefaultDatabaseValues(object):
class DefaultDatabaseValues:
def __init__(self):
pass

Expand Down
4 changes: 2 additions & 2 deletions eos/effectHandlerHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion eos/eqBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# ===============================================================================


class EqBase(object):
class EqBase:
ID = None

def __eq__(self, other):
Expand Down
8 changes: 4 additions & 4 deletions eos/modifiedAttributeDict.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
cappingAttrKeyCache = {}


class ItemAttrShortcut(object):
class ItemAttrShortcut:
def getModifiedItemAttr(self, key, default=0):
return_value = self.itemModifiedAttributes.get(key)

Expand All @@ -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)

Expand All @@ -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

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion eos/saveddata/boosterSideEffect.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
pyfalog = Logger(__name__)


class BoosterSideEffect(object):
class BoosterSideEffect:

def __init__(self, effect):
"""Initialize from the program"""
Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/character.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
pyfalog = Logger(__name__)


class Character(object):
class Character:
__itemList = None
__itemIDMap = None
__itemNameMap = None
Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/damagePattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import eos.db


class DamagePattern(object):
class DamagePattern:
DAMAGE_TYPES = ("em", "thermal", "kinetic", "explosive")

def __init__(self, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/fighterAbility.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
pyfalog = Logger(__name__)


class Fit(object):
class Fit:
"""Represents a fitting, with modules, ship, implants, etc."""

PEAK_RECHARGE = 0.25
Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/implantSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/price.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PriceStatus(IntEnum):
fetchTimeout = 4


class Price(object):
class Price:
def __init__(self, typeID):
self.typeID = typeID
self.time = 0
Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/ssocharacter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/targetResists.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion eos/saveddata/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion gui/bitmap_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
4 changes: 2 additions & 2 deletions gui/builtinAdditionPanes/projectedView.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions gui/builtinShipBrowser/sfBrowserItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down Expand Up @@ -85,7 +85,7 @@ def GetDropShadowBitmap(self):
return self.dropShadowBmp


class PFToolbar(object):
class PFToolbar:
def __init__(self, parent):
self.Parent = parent
self.buttons = []
Expand Down
2 changes: 1 addition & 1 deletion gui/errorDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
pyfalog = Logger(__name__)


class ErrorHandler(object):
class ErrorHandler:
__parent = None
__frame = None

Expand Down
4 changes: 2 additions & 2 deletions gui/esiFittings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions gui/graphFrame/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand Down
7 changes: 7 additions & 0 deletions gui/graphFrame/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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)
Expand Down Expand Up @@ -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():
Expand All @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion gui/multiSwitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def DeletePage(self, n, *args, **kwargs):
if self.GetPageCount() == 0:
self.AddPage()

class TabSpawner(object):
class TabSpawner:
tabTypes = []

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion gui/utils/exportHtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
pyfalog = Logger(__name__)


class exportHtml(object):
class exportHtml:
_instance = None

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion gui/viewColumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion service/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import eos.db


class Attribute(object):
class Attribute:
instance = None

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion service/character.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def run(self):
wx.CallAfter(self.callback)


class Character(object):
class Character:
instance = None
skillReqsDict = {}

Expand Down
Loading

0 comments on commit 5b74c6c

Please sign in to comment.