Merge branch 'master' into bug/1263

This commit is contained in:
Ryan Holmes
2017-09-23 12:56:29 -04:00
committed by GitHub
3 changed files with 14 additions and 4 deletions

View File

@@ -25,8 +25,10 @@ from eos.saveddata.price import Price
prices_table = Table("prices", saveddata_meta,
Column("typeID", Integer, primary_key=True),
Column("price", Float),
Column("price", Float, default=0.0),
Column("time", Integer, nullable=False),
Column("failed", Integer))
mapper(Price, prices_table)
mapper(Price, prices_table, properties={
"_Price__price": prices_table.c.price,
})

View File

@@ -457,7 +457,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
# Check max group fitted
max = self.getModifiedItemAttr("maxGroupFitted")
if max is not None:
current = 0 if self.owner != fit else -1
current = 0 # if self.owner != fit else -1 # Disabled, see #1278
for mod in fit.modules:
if mod.item and mod.item.groupID == self.item.groupID:
current += 1

View File

@@ -30,7 +30,7 @@ class Price(object):
def __init__(self, typeID):
self.typeID = typeID
self.time = 0
self.price = 0
self.__price = 0
self.failed = None
@reconstructor
@@ -40,3 +40,11 @@ class Price(object):
@property
def isValid(self):
return self.time >= time.time()
@property
def price(self):
return self.__price or 0.0
@price.setter
def price(self, price):
self.__price = price