Update graph info when fit name changes

This commit is contained in:
DarkPhoenix
2019-07-07 02:33:54 +03:00
parent 3e410540c9
commit 5b74c6c5e1
41 changed files with 61 additions and 47 deletions

View File

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

View File

@@ -13,7 +13,7 @@ def lcm(a, b):
return n / a
class CapSimulator(object):
class CapSimulator:
"""Entity's EVE Capacitor Simulator"""
def __init__(self):

View File

@@ -23,7 +23,7 @@ from logbook import Logger
pyfalog = Logger(__name__)
class DatabaseCleanup(object):
class DatabaseCleanup:
def __init__(self):
pass

View File

@@ -82,7 +82,7 @@ commandFits_table = Table("commandFits", saveddata_meta,
)
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 @@ class ProjectedFit(object):
)
class CommandFit(object):
class CommandFit:
def __init__(self, boosterID, booster_fit, active=True):
self.boosterID = boosterID
self.booster_fit = booster_fit

View File

@@ -26,7 +26,7 @@ class ImportError(Exception):
pass
class DefaultDatabaseValues(object):
class DefaultDatabaseValues:
def __init__(self):
pass

View File

@@ -394,7 +394,7 @@ class HandledProjectedDroneList(HandledDroneCargoList):
proj.projected = False
class HandledItem(object):
class HandledItem:
def preAssignItemAttr(self, *args, **kwargs):
self.itemModifiedAttributes.preAssign(*args, **kwargs)
@@ -411,7 +411,7 @@ class HandledItem(object):
self.itemModifiedAttributes.force(*args, **kwargs)
class HandledCharge(object):
class HandledCharge:
def preAssignChargeAttr(self, *args, **kwargs):
self.chargeModifiedAttributes.preAssign(*args, **kwargs)

View File

@@ -18,7 +18,7 @@
# ===============================================================================
class EqBase(object):
class EqBase:
ID = None
def __eq__(self, other):

View File

@@ -27,7 +27,7 @@ defaultValuesCache = {}
cappingAttrKeyCache = {}
class ItemAttrShortcut(object):
class ItemAttrShortcut:
def getModifiedItemAttr(self, key, default=0):
return_value = self.itemModifiedAttributes.get(key)
@@ -50,7 +50,7 @@ class ItemAttrShortcut(object):
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 @@ class ChargeAttrShortcut(object):
class ModifiedAttributeDict(collections.MutableMapping):
overrides_enabled = False
class CalculationPlaceholder(object):
class CalculationPlaceholder:
def __init__(self):
pass
@@ -441,7 +441,7 @@ class ModifiedAttributeDict(collections.MutableMapping):
return resist or 1.0
class Affliction(object):
class Affliction:
def __init__(self, affliction_type, amount):
self.type = affliction_type
self.amount = amount

View File

@@ -24,7 +24,7 @@ from sqlalchemy.orm import reconstructor
pyfalog = Logger(__name__)
class BoosterSideEffect(object):
class BoosterSideEffect:
def __init__(self, effect):
"""Initialize from the program"""

View File

@@ -32,7 +32,7 @@ from eos.effectHandlerHelpers import HandledItem, HandledImplantList
pyfalog = Logger(__name__)
class Character(object):
class Character:
__itemList = None
__itemIDMap = None
__itemNameMap = None

View File

@@ -21,7 +21,7 @@ import re
import eos.db
class DamagePattern(object):
class DamagePattern:
DAMAGE_TYPES = ("em", "thermal", "kinetic", "explosive")
def __init__(self, *args, **kwargs):

View File

@@ -26,7 +26,7 @@ from eos.utils.stats import DmgTypes
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

View File

@@ -42,7 +42,7 @@ from eos.utils.stats import DmgTypes
pyfalog = Logger(__name__)
class Fit(object):
class Fit:
"""Represents a fitting, with modules, ship, implants, etc."""
PEAK_RECHARGE = 0.25

View File

@@ -22,7 +22,7 @@ from copy import deepcopy
from eos.effectHandlerHelpers import HandledImplantList
class ImplantSet(object):
class ImplantSet:
def __init__(self, name=None):
self.name = name
self.__implants = HandledImplantList()

View File

@@ -42,7 +42,7 @@ class PriceStatus(IntEnum):
fetchTimeout = 4
class Price(object):
class Price:
def __init__(self, typeID):
self.typeID = typeID
self.time = 0

View File

@@ -24,7 +24,7 @@ import time
# 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

View File

@@ -24,7 +24,7 @@ import eos.db
pyfalog = Logger(__name__)
class TargetResists(object):
class TargetResists:
# also determined import/export order - VERY IMPORTANT
DAMAGE_TYPES = ("em", "thermal", "kinetic", "explosive")

View File

@@ -24,7 +24,7 @@ import string
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:

View File

@@ -31,7 +31,7 @@ import config
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.")

View File

@@ -42,13 +42,13 @@ from service.market import Market
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)

View File

@@ -14,7 +14,7 @@ BTN_HOVER = 4
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 @@ class PFBaseButton(object):
return self.dropShadowBmp
class PFToolbar(object):
class PFToolbar:
def __init__(self, parent):
self.Parent = parent
self.buttons = []

View File

@@ -31,7 +31,7 @@ import datetime
pyfalog = Logger(__name__)
class ErrorHandler(object):
class ErrorHandler:
__parent = None
__frame = None

View File

@@ -172,7 +172,7 @@ class EveFittings(wx.Frame):
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 @@ class ESIServerExceptionHandler(object):
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

View File

@@ -31,6 +31,7 @@ import gui.globalEvents as GE
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 @@ class GraphFrame(wx.Frame):
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 @@ class GraphFrame(wx.Frame):
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 @@ class GraphFrame(wx.Frame):
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()

View File

@@ -23,6 +23,7 @@ import wx
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 @@ class BaseList(gui.display.Display):
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 @@ class BaseList(gui.display.Display):
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 @@ class BaseList(gui.display.Display):
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':

View File

@@ -47,7 +47,7 @@ class MultiSwitch(ChromeNotebook):
if self.GetPageCount() == 0:
self.AddPage()
class TabSpawner(object):
class TabSpawner:
tabTypes = []
@classmethod

View File

@@ -13,7 +13,7 @@ from eos.db import getFit
pyfalog = Logger(__name__)
class exportHtml(object):
class exportHtml:
_instance = None
@classmethod

View File

@@ -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,

View File

@@ -20,7 +20,7 @@
import eos.db
class Attribute(object):
class Attribute:
instance = None
@classmethod

View File

@@ -122,7 +122,7 @@ class SkillBackupThread(threading.Thread):
wx.CallAfter(self.callback)
class Character(object):
class Character:
instance = None
skillReqsDict = {}

View File

@@ -27,7 +27,7 @@ class ImportError(Exception):
pass
class DamagePattern(object):
class DamagePattern:
instance = None
@classmethod

View File

@@ -61,7 +61,7 @@ class APIException(Exception):
return 'HTTP Error %s' % self.status_code
class EsiAccess(object):
class EsiAccess:
def __init__(self):
self.settings = EsiSettings.getInstance()

View File

@@ -29,7 +29,7 @@ class ImportError(Exception):
pass
class ImplantSets(object):
class ImplantSets:
instance = None
@classmethod

View File

@@ -18,7 +18,7 @@
# =============================================================================
class Jargon(object):
class Jargon:
def __init__(self, rawdata: dict):
self._rawdata = rawdata

View File

@@ -27,7 +27,7 @@ from .resources import DEFAULT_DATA, DEFAULT_HEADER
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

View File

@@ -140,7 +140,7 @@ class SearchWorkerThread(threading.Thread):
self.cv.release()
class Market(object):
class Market:
instance = None
def __init__(self):

View File

@@ -46,7 +46,7 @@ pyfalog = Logger(__name__)
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

View File

@@ -27,7 +27,7 @@ class ImportError(Exception):
pass
class TargetResists(object):
class TargetResists:
instance = None
@classmethod

View File

@@ -91,7 +91,7 @@ class CheckUpdateThread(threading.Thread):
return tuple(map(int, (v.split("."))))
class Update(object):
class Update:
instance = None
@staticmethod

View File

@@ -4,7 +4,7 @@ import time
import os
class Stopwatch(object):
class Stopwatch:
"""
--- on python console ---
import re

View File

@@ -1,7 +1,7 @@
import time
class Timer(object):
class Timer:
def __init__(self, name='', logger=None):
self.name = name
self.start = time.time()