Code consistency
This commit is contained in:
@@ -29,8 +29,8 @@ class AttributeDisplay(ViewColumn):
|
||||
name = "attr"
|
||||
def __init__(self, fittingView, params):
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
cAttribute = service.Attribute.getInstance()
|
||||
info = cAttribute.getAttributeInfo(params["attribute"])
|
||||
sAttr = service.Attribute.getInstance()
|
||||
info = sAttr.getAttributeInfo(params["attribute"])
|
||||
self.info = info
|
||||
if params["showIcon"]:
|
||||
if info.name == "power":
|
||||
@@ -57,10 +57,10 @@ class AttributeDisplay(ViewColumn):
|
||||
self.direct = True
|
||||
self.view = fittingView
|
||||
originalRefresh = fittingView.refresh
|
||||
sMarket = service.Market.getInstance()
|
||||
sMkt = service.Market.getInstance()
|
||||
#Hack into our master view and add a callback for ourselves to know when to query
|
||||
def refresh(stuff):
|
||||
self.directInfo = sMarket.directAttrRequest(stuff, info) if stuff else None
|
||||
self.directInfo = sMkt.directAttrRequest(stuff, info) if stuff else None
|
||||
originalRefresh(stuff)
|
||||
|
||||
fittingView.refresh = refresh
|
||||
|
||||
@@ -31,8 +31,8 @@ class CapacitorUse(ViewColumn):
|
||||
|
||||
self.mask = wx.LIST_MASK_IMAGE
|
||||
|
||||
cAttribute = service.Attribute.getInstance()
|
||||
info = cAttribute.getAttributeInfo("capacitorNeed")
|
||||
sAttr = service.Attribute.getInstance()
|
||||
info = sAttr.getAttributeInfo("capacitorNeed")
|
||||
self.imageId = fittingView.imageList.GetImageIndex(info.icon.iconFile, "pack")
|
||||
self.bitmap = bitmapLoader.getBitmap(info.icon.iconFile, "pack")
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ class MaxRange(ViewColumn):
|
||||
"displayName": False}
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
|
||||
cAttribute = service.Attribute.getInstance()
|
||||
info = cAttribute.getAttributeInfo("maxRange")
|
||||
sAttr = service.Attribute.getInstance()
|
||||
info = sAttr.getAttributeInfo("maxRange")
|
||||
self.info = info
|
||||
if params["showIcon"]:
|
||||
iconFile = info.icon.iconFile if info.icon else None
|
||||
|
||||
@@ -35,8 +35,8 @@ class Price(ViewColumn):
|
||||
if stuff.item is None:
|
||||
return ""
|
||||
|
||||
sMarket = service.Market.getInstance()
|
||||
price = sMarket.getPriceNow(stuff.item.ID)
|
||||
sMkt = service.Market.getInstance()
|
||||
price = sMkt.getPriceNow(stuff.item.ID)
|
||||
return formatAmount(price.price, 3, 3, 9, currency=True) if price and price.price else False
|
||||
|
||||
def delayedText(self, mod, display, colItem):
|
||||
|
||||
@@ -27,11 +27,11 @@ class PropertyDisplay(ViewColumn):
|
||||
name = "prop"
|
||||
def __init__(self, fittingView, params):
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
cAttribute = service.Attribute.getInstance()
|
||||
sAttr = service.Attribute.getInstance()
|
||||
attributeSlave = params["attributeSlave"] or params["property"]
|
||||
# This function can throw an exception if the database isn't sane
|
||||
# We need to do a sanity check before this runs
|
||||
info = cAttribute.getAttributeInfo(attributeSlave)
|
||||
info = sAttr.getAttributeInfo(attributeSlave)
|
||||
|
||||
self.mask = 0
|
||||
self.propertyName = params["property"]
|
||||
|
||||
Reference in New Issue
Block a user