Skip to content
Permalink
Browse files

Merge pull request #85 from Pyfa-fit/development

2017.05.11
  • Loading branch information...
Ebag333 committed May 12, 2017
2 parents 3906355 + 5f683e7 commit 216d29cbc617a6ddfb0ccccbbd1f3025a51fceee
Showing with 6,351 additions and 784 deletions.
  1. +3 −3 config.py
  2. +1 −0 eos/config.py
  3. +6 −14 eos/db/gamedata/effect.py
  4. +2 −1 eos/db/gamedata/item.py
  5. +69 −3 eos/db/gamedata/queries.py
  6. +3 −1 eos/db/migration.py
  7. +13 −0 eos/db/migrations/upgrade23.py
  8. +14 −0 eos/db/migrations/upgrade24.py
  9. +10 −5 eos/db/saveddata/cargo.py
  10. +6 −4 eos/db/saveddata/character.py
  11. +2 −2 eos/db/saveddata/crest.py
  12. +3 −3 eos/db/saveddata/damagePattern.py
  13. +10 −5 eos/db/saveddata/drone.py
  14. +3 −3 eos/db/saveddata/fighter.py
  15. +30 −14 eos/db/saveddata/fit.py
  16. +3 −3 eos/db/saveddata/implant.py
  17. +3 −3 eos/db/saveddata/implantSet.py
  18. +3 −3 eos/db/saveddata/module.py
  19. +3 −3 eos/db/saveddata/override.py
  20. +18 −0 eos/db/saveddata/queries.py
  21. +3 −3 eos/db/saveddata/skill.py
  22. +3 −3 eos/db/saveddata/targetResists.py
  23. +1 −1 eos/effects/ammoinfluencecapneed.py
  24. +1 −1 eos/effects/ammoinfluencerange.py
  25. +2 −2 eos/effects/commandburstaoerolebonus.py
  26. +22 −0 eos/effects/concordsecstatustankbonus.py
  27. +2 −2 eos/effects/covertopsandreconopscloakmoduledelaybonus.py
  28. +1 −1 eos/effects/covertopscloakcpupercentbonus1.py
  29. +4 −2 eos/effects/{covertopscloakcpupercentbonuspiratefaction.py → covertopscloakcpupercentrolebonus.py}
  30. +1 −1 eos/effects/cynosuraldurationbonus.py
  31. +1 −1 eos/effects/cynosuraltheoryconsumptionbonus.py
  32. +6 −1 eos/effects/ecmburstjammer.py
  33. +1 −1 eos/effects/elitebonuscoveropsscanprobestrength2.py
  34. +9 −0 eos/effects/elitebonuscoveropswarpvelocity1.py
  35. +9 −0 eos/effects/elitebonusreconwarpvelocity3.py
  36. +2 −1 eos/effects/{elitereconjumpscramblerrangebonus2.py → elitereconscramblerrangebonus2.py}
  37. +9 −0 eos/effects/elitereconstasiswebbonus1.py
  38. +7 −1 eos/effects/energyneutralizerfalloff.py
  39. +6 −1 eos/effects/energynosferatufalloff.py
  40. +6 −1 eos/effects/entityecmfalloff.py
  41. +5 −1 eos/effects/entityenergyneutralizerfalloff.py
  42. +1 −6 eos/effects/entosisdurationmultiply.py
  43. +5 −1 eos/effects/fighterabilityecm.py
  44. +6 −1 eos/effects/fighterabilityenergyneutralizer.py
  45. +1 −1 eos/effects/minigamevirusstrengthbonus.py
  46. +2 −2 eos/effects/modulebonusancillaryremotearmorrepairer.py
  47. +2 −2 eos/effects/modulebonusancillaryremoteshieldbooster.py
  48. +4 −4 eos/effects/npcentityweapondisruptor.py
  49. +1 −1 eos/effects/reconshipcloakcpubonus1.py
  50. +2 −2 eos/effects/remotearmorrepairfalloff.py
  51. +6 −1 eos/effects/remoteecmfalloff.py
  52. +3 −3 eos/effects/remotesensordampentity.py
  53. +3 −3 eos/effects/remotesensordampfalloff.py
  54. +2 −2 eos/effects/remoteshieldtransferfalloff.py
  55. +2 −2 eos/effects/remotetargetpaintentity.py
  56. +2 −2 eos/effects/remotetargetpaintfalloff.py
  57. +2 −2 eos/effects/remotewebifierentity.py
  58. +2 −2 eos/effects/remotewebifierfalloff.py
  59. +1 −1 eos/effects/scriptdurationbonus.py
  60. +1 −1 eos/effects/scriptmassbonuspercentagebonus.py
  61. +1 −1 eos/effects/scriptsignatureradiusbonusbonus.py
  62. +1 −1 eos/effects/scriptspeedboostfactorbonusbonus.py
  63. +1 −1 eos/effects/scriptspeedfactorbonusbonus.py
  64. +1 −1 eos/effects/scriptwarpdisruptionfieldgeneratorsetdisallowinempirespace.py
  65. +1 −1 eos/effects/scriptwarpscramblerangebonus.py
  66. +0 −1 eos/effects/shieldmanagementshieldcapacitybonuspostpercentcapacitylocationshipgroupshield.py
  67. +1 −1 eos/effects/shipadvancedspaceshipcommandagilitybonus.py
  68. +12 −0 eos/effects/shipbonusdreadnoughta1energywarfareamountbonus.py
  69. +10 −0 eos/effects/shipbonusdreadnoughtm1webrangebonus.py
  70. +1 −1 eos/effects/{shipbonusdreadnoughtm1webbonus.py → shipbonusdreadnoughtm1webstrengthbonus.py}
  71. +1 −1 eos/effects/shipbonusdronemwdboostrole.py
  72. +10 −0 eos/effects/shipbonusforceauxiliarya1nosferatudrainamount.py
  73. +12 −0 eos/effects/shipbonusforceauxiliarya1nosferaturangebonus.py
  74. +10 −0 eos/effects/shipbonusforceauxiliarym1remotearmorrepairduration.py
  75. +1 −1 ...ffects/{shipbonusforceauxiliarym1remotecycletime.py → shipbonusforceauxiliarym1remoteduration.py}
  76. +8 −0 eos/effects/shipbonusforceauxiliarym2localrepairamount.py
  77. +1 −1 eos/effects/shipbonusheavydronearmorhppiratefaction.py
  78. +1 −1 eos/effects/shipbonusheavydronedamagemultiplierpiratefaction.py
  79. +1 −1 eos/effects/shipbonusheavydronehppiratefaction.py
  80. +1 −1 eos/effects/shipbonusheavydroneshieldhppiratefaction.py
  81. +1 −0 eos/effects/shipbonushybridtrackinggf2.py
  82. +1 −1 eos/effects/shipbonusletoptimalrangepiratefaction.py
  83. +1 −1 eos/effects/shipbonuslightdronearmorhppiratefaction.py
  84. +1 −1 eos/effects/shipbonuslightdronedamagemultiplierpiratefaction.py
  85. +1 −1 eos/effects/shipbonuslightdronehppiratefaction.py
  86. +1 −1 eos/effects/shipbonuslightdroneshieldhppiratefaction.py
  87. +1 −1 eos/effects/shipbonusmediumdronearmorhppiratefaction.py
  88. +1 −1 eos/effects/shipbonusmediumdronedamagemultiplierpiratefaction.py
  89. +1 −1 eos/effects/shipbonusmediumdronehppiratefaction.py
  90. +1 −1 eos/effects/shipbonusmediumdroneshieldhppiratefaction.py
  91. +1 −1 eos/effects/shipbonusmediumenergyturretdamagepiratefaction.py
  92. +12 −0 eos/effects/shipbonusmedmissileflighttimecc2.py
  93. +1 −0 eos/effects/shipbonusmetoptimalac2.py
  94. +1 −1 eos/effects/shipbonusmetoptimalrangepiratefaction.py
  95. +1 −1 eos/effects/shipbonuspiratefrigateprojdamage.py
  96. +1 −1 eos/effects/shipbonuspiratesmallhybriddmg.py
  97. +1 −1 eos/effects/shipbonusremoterepairamountpiratefaction.py
  98. +1 −1 eos/effects/{shipbonusdreadnoughtrole1damagebonus.py → shipbonusrole1capitalhybriddamagebonus.py}
  99. +2 −2 eos/effects/{shipbonusforceauxiliaryrole1cpubonus.py → shipbonusrole1commandburstcpubonus.py}
  100. +2 −2 eos/effects/{shipbonustitanrole1numwarfarelinks.py → shipbonusrole1numwarfarelinks.py}
  101. +2 −2 ...{shipbonustitanrole2armorshieldmodulebonus.py → shipbonusrole2armorplatesshieldextendersbonus.py}
  102. +2 −2 ...effects/{shipbonusforceauxiliaryrole2logisticdronebonus.py → shipbonusrole2logisticdronebonus.py}
  103. +10 −0 eos/effects/shipbonusrole3capitalenergydamagebonus.py
  104. +1 −1 eos/effects/{shipbonustitanrole3damagebonus.py → shipbonusrole3capitalhybriddamagebonus.py}
  105. +2 −2 eos/effects/{shipbonusforceauxiliaryrole3numwarfarelinks.py → shipbonusrole3numwarfarelinks.py}
  106. +10 −0 eos/effects/shipbonusrole4nosferatucpubonus.py
  107. +9 −0 eos/effects/shipbonusrole5capitalremotearmorrepairpowergridbonus.py
  108. +2 −2 eos/effects/{remotearmorpowerneedbonuseffect.py → shipbonusrole5remotearmorrepairpowergridbonus.py}
  109. +1 −1 eos/effects/shipbonussentrydronearmorhppiratefaction.py
  110. +1 −1 eos/effects/shipbonussentrydronedamagemultiplierpiratefaction.py
  111. +1 −1 eos/effects/shipbonussentrydronehppiratefaction.py
  112. +1 −1 eos/effects/shipbonussentrydroneshieldhppiratefaction.py
  113. +1 −1 eos/effects/shipbonussmallenergyturretdamagepiratefaction.py
  114. +12 −0 eos/effects/shipbonussmallmissileflighttimecf1.py
  115. +2 −1 eos/effects/{shipmissilespeedbonuscf.py → shipbonussmallmissilerofcf2.py}
  116. +1 −0 eos/effects/shipbonussptfalloffmf2.py
  117. +10 −0 eos/effects/shipbonussptrofmf.py
  118. +1 −1 eos/effects/shipbonussurveyprobeexplosiondelayskillsurveycovertops3.py
  119. +12 −0 eos/effects/shipbonustitana1energywarfareamountbonus.py
  120. +1 −0 eos/effects/shipbonustitana3warpstrength.py
  121. +10 −0 eos/effects/shipbonustitanm1webrangebonus.py
  122. +1 −1 eos/effects/{shipbonustitanm1webbonus.py → shipbonustitanm1webstrengthbonus.py}
  123. +1 −2 eos/effects/shipbonustitanm3warpstrength.py
  124. +1 −6 eos/effects/shipcapitalagilitybonus.py
  125. +1 −0 eos/effects/shipetdamageaf.py
  126. +1 −0 eos/effects/shipetoptimalrange2af.py
  127. +1 −1 eos/effects/shipheavyassaultmissileemdmgpiratecruiser.py
  128. +1 −1 eos/effects/shipheavyassaultmissileexpdmgpiratecruiser.py
  129. +1 −1 eos/effects/shipheavyassaultmissilekindmgpiratecruiser.py
  130. +1 −1 eos/effects/shipheavyassaultmissilethermdmgpiratecruiser.py
  131. +1 −1 eos/effects/shipheavymissileemdmgpiratecruiser.py
  132. +1 −1 eos/effects/shipheavymissileexpdmgpiratecruiser.py
  133. +1 −1 eos/effects/shipheavymissilekindmgpiratecruiser.py
  134. +1 −1 eos/effects/shipheavymissilethermdmgpiratecruiser.py
  135. +1 −0 eos/effects/shiphtdmgbonusfixedgc.py
  136. +1 −1 eos/effects/shiphybriddmgpiratebattleship.py
  137. +1 −1 eos/effects/shiphybriddmgpiratecruiser.py
  138. +1 −0 eos/effects/shiphybridtrackinggc2.py
  139. +1 −1 eos/effects/shiplaserdamagepiratebattleship.py
  140. +1 −0 eos/effects/shipmetcdamagebonusac.py
  141. +1 −0 eos/effects/shipmissilerofcc.py
  142. +1 −1 eos/effects/shipmissilevelocitypiratefactionfrigate.py
  143. +1 −1 eos/effects/shipmissilevelocitypiratefactionlight.py
  144. +1 −1 eos/effects/shipmissilevelocitypiratefactionrocket.py
  145. +2 −2 eos/effects/shipmoduleguidancedisruptor.py
  146. +4 −4 eos/effects/shipmoduleremotetrackingcomputer.py
  147. +4 −4 eos/effects/shipmoduletrackingdisruptor.py
  148. +1 −1 eos/effects/shipprojectiledmgpiratecruiser.py
  149. +1 −1 eos/effects/shipprojectilerofpiratebattleship.py
  150. +1 −1 eos/effects/shipprojectilerofpiratecruiser.py
  151. +1 −0 eos/effects/shippturretfalloffbonusmc2.py
  152. +1 −0 eos/effects/shippturretspeedbonusmc.py
  153. +1 −1 eos/effects/shipscanprobestrengthbonuspiratefaction.py
  154. +1 −0 eos/effects/shipshtdmgbonusgf.py
  155. +2 −2 eos/effects/shipsmallmissiledmgpiratefaction.py
  156. +1 −1 eos/effects/shipxlprojectiledamagerole.py
  157. +3 −3 eos/effects/structuremoduleeffectremotesensordampener.py
  158. +2 −2 eos/effects/structuremoduleeffectstasiswebifier.py
  159. +2 −2 eos/effects/structuremoduleeffecttargetpainter.py
  160. +5 −5 eos/effects/structuremoduleeffectweapondisruption.py
  161. +87 −0 eos/events.py
  162. +26 −7 eos/gamedata.py
  163. +39 −15 eos/modifiedAttributeDict.py
  164. +42 −7 eos/saveddata/character.py
  165. +40 −6 eos/saveddata/fit.py
  166. +22 −4 eos/saveddata/module.py
  167. +5 −0 eos/saveddata/ship.py
  168. BIN eve.db
  169. +1 −1 gui/boosterView.py
  170. +1 −1 gui/builtinContextMenus/droneSplit.py
  171. +6 −2 gui/builtinContextMenus/itemRemove.py
  172. +1 −1 gui/builtinContextMenus/openFit.py
  173. +67 −0 gui/builtinContextMenus/tabbedFits.py
  174. +20 −24 gui/builtinPreferenceViews/pyfaEnginePreferences.py
  175. +61 −6 gui/builtinPreferenceViews/pyfaGeneralPreferences.py
  176. +7 −2 gui/builtinViewColumns/misc.py
  177. +9 −9 gui/builtinViews/entityEditor.py
  178. +27 −16 gui/builtinViews/fittingView.py
  179. +172 −27 gui/characterEditor.py
  180. +67 −13 gui/characterSelection.py
  181. +20 −6 gui/chromeTabs.py
  182. +1 −0 gui/contextMenu.py
  183. +12 −0 gui/display.py
  184. +1 −1 gui/droneView.py
  185. +1 −1 gui/implantView.py
  186. +133 −21 gui/itemStats.py
  187. +72 −36 gui/mainFrame.py
  188. +14 −2 gui/marketBrowser.py
  189. +10 −2 gui/pygauge.py
  190. +47 −9 gui/recentShipBrowser.py
  191. +87 −26 gui/shipBrowser.py
  192. +7 −2 gui/statsPane.py
  193. +1,659 −0 gui/utils/floatspin.py
  194. BIN imgs/gui/frecent_small.png
  195. BIN imgs/renders/42241.png
  196. BIN imgs/renders/42242.png
  197. BIN imgs/renders/42243.png
  198. BIN imgs/renders/44993.png
  199. BIN imgs/renders/44995.png
  200. +18 −0 pyfa.py
  201. +2 −3 scripts/jsonToSql.py
  202. +78 −36 service/character.py
  203. +24 −3 service/fit.py
  204. +449 −231 service/port.py
  205. +3 −16 service/price.py
  206. +25 −12 service/settings.py
  207. +21 −1 setup.py
  208. +2,116 −0 tests/jeffy_ja-en[99].xml
  209. +89 −0 tests/test_unread_desc.py
  210. +1 −1 tox.ini
  211. +122 −0 utils/stopwatch.py
  212. +30 −0 utils/strfunctions.py
@@ -25,14 +25,14 @@
saveInRoot = False

# Version data
version = "2017.04.26"
version = "2017.05.11"
if hasattr(sys, 'frozen'):
tag = "(release)"
else:
tag = "(live)"
expansionName = "YC119.3"
expansionName = "YC119.5"
expansionVersion = "1.0"
evemonMinVersion = "4081"
evemonMinVersion = "2"

pyfaPath = None
savePath = None
@@ -30,6 +30,7 @@
"useStaticAdaptiveArmorHardener": False,
"strictFitting" : True,
"fireAtPercentCapacitor" : 25,
"strictSkillLevels" : True,
}

# Autodetect path, only change if the autodetection bugs out.
@@ -18,11 +18,10 @@
# ===============================================================================

from sqlalchemy import Column, String, Integer, Boolean, Table, ForeignKey
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import mapper, synonym, relation, deferred
from sqlalchemy.orm import mapper, synonym, deferred

from eos.db import gamedata_meta
from eos.gamedata import Effect, EffectInfo
from eos.gamedata import Effect, ItemEffect

typeeffects_table = Table("dgmtypeeffects", gamedata_meta,
Column("typeID", Integer, ForeignKey("invtypes.typeID"), primary_key=True, index=True),
@@ -34,21 +33,14 @@
Column("description", String),
Column("published", Boolean),
Column("isAssistance", Boolean),
Column("isOffensive", Boolean))
Column("isOffensive", Boolean),
Column("resistanceID", Integer))

mapper(EffectInfo, effects_table,
mapper(Effect, effects_table,
properties={
"ID" : synonym("effectID"),
"name" : synonym("effectName"),
"description": deferred(effects_table.c.description)
})

mapper(Effect, typeeffects_table,
properties={
"ID" : synonym("effectID"),
"info": relation(EffectInfo, lazy=False)
})

Effect.name = association_proxy("info", "name")
Effect.description = association_proxy("info", "description")
Effect.published = association_proxy("info", "published")
mapper(ItemEffect, typeeffects_table)
@@ -21,6 +21,7 @@
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import relation, mapper, synonym, deferred
from sqlalchemy.orm.collections import attribute_mapped_collection
from eos.db.gamedata.effect import typeeffects_table

from eos.db import gamedata_meta
from eos.gamedata import Attribute, Effect, Group, Icon, Item, MetaType, Traits
@@ -47,7 +48,7 @@
"group" : relation(Group, backref="items"),
"icon" : relation(Icon),
"_Item__attributes": relation(Attribute, collection_class=attribute_mapped_collection('name')),
"effects" : relation(Effect, collection_class=attribute_mapped_collection('name')),
"effects": relation(Effect, secondary=typeeffects_table, collection_class=attribute_mapped_collection('name')),
"metaGroup" : relation(MetaType,
primaryjoin=metatypes_table.c.typeID == items_table.c.typeID,
uselist=False),
@@ -17,7 +17,7 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================

from sqlalchemy.orm import join, exc
from sqlalchemy.orm import join, exc, aliased
from sqlalchemy.sql import and_, or_, select

import eos.config
@@ -27,12 +27,11 @@
from eos.db.util import processEager, processWhere
from eos.gamedata import AlphaClone, Attribute, Category, Group, Item, MarketGroup, MetaGroup, AttributeInfo, MetaData

cache = {}
configVal = getattr(eos.config, "gamedataCache", None)
if configVal is True:
def cachedQuery(amount, *keywords):
def deco(function):
cache = {}

def checkAndReturn(*args, **kwargs):
useCache = kwargs.pop("useCache", True)
cacheKey = []
@@ -99,6 +98,35 @@ def getItem(lookfor, eager=None):
return item


@cachedQuery(1, "lookfor")
def getItems(lookfor, eager=None):
"""
Gets a list of items. Does a bit of cache hackery to get working properly -- cache
is usually based on function calls with the parameters, needed to extract data directly.
Works well enough. Not currently used, but it's here for possible future inclusion
"""

toGet = []
results = []

for _id in lookfor:
if (_id, None) in cache:
results.append(cache.get((_id, None)))
else:
toGet.append(_id)

if len(toGet) > 0:
# Get items that aren't currently cached, and store them in the cache
items = gamedata_session.query(Item).filter(Item.ID.in_(toGet)).all()
for item in items:
cache[(item.ID, None)] = item
results += items

# sort the results based on the original indexing
results.sort(key=lambda x: lookfor.index(x.ID))
return results


@cachedQuery(1, "lookfor")
def getAlphaClone(lookfor, eager=None):
if isinstance(lookfor, int):
@@ -259,6 +287,22 @@ def searchItems(nameLike, where=None, join=None, eager=None, result_limit=150):
return items


@cachedQuery(3, "where", "nameLike", "join")
def searchSkills(nameLike, where=None, eager=None):
if not isinstance(nameLike, basestring):
raise TypeError("Need string as argument")

items = gamedata_session.query(Item).options(*processEager(eager)).join(Item.group, Group.category)
for token in nameLike.split(' '):
token_safe = u"%{0}%".format(sqlizeString(token))
if where is not None:
items = items.filter(and_(Item.name.like(token_safe, escape="\\"), Category.ID == 16, where))
else:
items = items.filter(and_(Item.name.like(token_safe, escape="\\"), Category.ID == 16))
items = items.limit(100).all()
return items


@cachedQuery(2, "where", "itemids")
def getVariations(itemids, groupIDs=None, where=None, eager=None):
for itemid in itemids:
@@ -325,3 +369,25 @@ def directAttributeRequest(itemIDs, attrIDs):

result = gamedata_session.execute(q).fetchall()
return result


def getRequiredFor(itemID, attrMapping):
Attribute1 = aliased(Attribute)
Attribute2 = aliased(Attribute)

skillToLevelClauses = []

for attrSkill, attrLevel in attrMapping.iteritems():
skillToLevelClauses.append(and_(Attribute1.attributeID == attrSkill, Attribute2.attributeID == attrLevel))

queryOr = or_(*skillToLevelClauses)

q = select((Attribute2.typeID, Attribute2.value),
and_(Attribute1.value == itemID, queryOr),
from_obj=[
join(Attribute1, Attribute2, Attribute1.typeID == Attribute2.typeID)
])

result = gamedata_session.execute(q).fetchall()

return result
@@ -27,6 +27,8 @@
upgrade20,
upgrade21,
upgrade22,
upgrade23,
upgrade24,
)

pyfalog = Logger(__name__)
@@ -41,7 +43,7 @@ def update(saveddata_engine):
pyfalog.info("Database upgrade in progress.")
dbVersion = True

while dbVersion is True:
while dbVersion:
dbVersion = getVersion(saveddata_engine)

current_upgrade = "upgrade" + str(dbVersion + 1)
@@ -0,0 +1,13 @@
"""
Migration 23
- Adds a sec status field to the character table
"""
import sqlalchemy


def upgrade(saveddata_engine):
try:
saveddata_engine.execute("SELECT secStatus FROM characters LIMIT 1")
except sqlalchemy.exc.DatabaseError:
saveddata_engine.execute("ALTER TABLE characters ADD COLUMN secStatus FLOAT;")
@@ -0,0 +1,14 @@
"""
Migration 24
- Adds a boolean value to fit to signify if fit should ignore restrictions
"""
import sqlalchemy


def upgrade(saveddata_engine):
try:
saveddata_engine.execute("SELECT ignoreRestrictions FROM fits LIMIT 1")
except sqlalchemy.exc.DatabaseError:
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN ignoreRestrictions BOOLEAN")
saveddata_engine.execute("UPDATE fits SET ignoreRestrictions = 0")
@@ -18,19 +18,24 @@
# ===============================================================================

from sqlalchemy import Table, Column, Integer, ForeignKey, DateTime
from sqlalchemy.orm import mapper
import sqlalchemy.sql.functions as func
from sqlalchemy.orm import mapper, relation
import datetime

from eos.db import saveddata_meta
from eos.saveddata.cargo import Cargo
from eos.saveddata.fit import Fit

cargo_table = Table("cargo", saveddata_meta,
Column("ID", Integer, primary_key=True),
Column("fitID", Integer, ForeignKey("fits.ID"), nullable=False, index=True),
Column("itemID", Integer, nullable=False),
Column("amount", Integer, nullable=False),
Column("created", DateTime, nullable=True, default=func.now()),
Column("modified", DateTime, nullable=True, onupdate=func.now()),
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now),
)

mapper(Cargo, cargo_table)
mapper(Cargo, cargo_table,
properties={
"owner": relation(Fit)
}
)
@@ -17,9 +17,9 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
# ===============================================================================

from sqlalchemy import Table, Column, Integer, ForeignKey, String, DateTime
from sqlalchemy import Table, Column, Integer, ForeignKey, String, DateTime, Float
from sqlalchemy.orm import relation, mapper
import sqlalchemy.sql.functions as func
import datetime

from eos.db import saveddata_meta
from eos.db.saveddata.implant import charImplants_table
@@ -38,13 +38,15 @@
Column("defaultLevel", Integer, nullable=True),
Column("alphaCloneID", Integer, nullable=True),
Column("ownerID", ForeignKey("users.ID"), nullable=True),
Column("created", DateTime, nullable=True, default=func.now()),
Column("modified", DateTime, nullable=True, onupdate=func.now()))
Column("secStatus", Float, nullable=True, default=0.0),
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now))

mapper(Character, characters_table,
properties={
"_Character__alphaCloneID": characters_table.c.alphaCloneID,
"savedName" : characters_table.c.name,
"_Character__secStatus": characters_table.c.secStatus,
"_Character__owner" : relation(
User,
backref="characters"),
@@ -19,7 +19,7 @@

from sqlalchemy import Table, Column, Integer, String, DateTime
from sqlalchemy.orm import mapper
import sqlalchemy.sql.functions as func
import datetime

from eos.db import saveddata_meta
from eos.saveddata.crestchar import CrestChar
@@ -29,6 +29,6 @@
Column("name", String, nullable=False, unique=True),
Column("refresh_token", String, nullable=False),
# These records aren't updated. Instead, they are dropped and created, hence we don't have a modified field
Column("created", DateTime, nullable=True, default=func.now()))
Column("created", DateTime, nullable=True, default=datetime.datetime.now))

mapper(CrestChar, crest_table)
@@ -19,7 +19,7 @@

from sqlalchemy import Table, Column, Integer, ForeignKey, String, DateTime
from sqlalchemy.orm import mapper
import sqlalchemy.sql.functions as func
import datetime

from eos.db import saveddata_meta
from eos.saveddata.damagePattern import DamagePattern
@@ -32,8 +32,8 @@
Column("kineticAmount", Integer),
Column("explosiveAmount", Integer),
Column("ownerID", ForeignKey("users.ID"), nullable=True),
Column("created", DateTime, nullable=True, default=func.now()),
Column("modified", DateTime, nullable=True, onupdate=func.now())
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
)

mapper(DamagePattern, damagePatterns_table)
@@ -18,11 +18,12 @@
# ===============================================================================

from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean, DateTime
from sqlalchemy.orm import mapper
import sqlalchemy.sql.functions as func
from sqlalchemy.orm import mapper, relation
import datetime

from eos.db import saveddata_meta
from eos.saveddata.drone import Drone
from eos.saveddata.fit import Fit

drones_table = Table("drones", saveddata_meta,
Column("groupID", Integer, primary_key=True),
@@ -31,8 +32,12 @@
Column("amount", Integer, nullable=False),
Column("amountActive", Integer, nullable=False),
Column("projected", Boolean, default=False),
Column("created", DateTime, nullable=True, default=func.now()),
Column("modified", DateTime, nullable=True, onupdate=func.now())
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
)

mapper(Drone, drones_table)
mapper(Drone, drones_table,
properties={
"owner": relation(Fit)
}
)
@@ -19,7 +19,7 @@

from sqlalchemy import Table, Column, Integer, ForeignKey, Boolean, DateTime
from sqlalchemy.orm import mapper, relation
import sqlalchemy.sql.functions as func
import datetime

from eos.db import saveddata_meta
from eos.saveddata.fighterAbility import FighterAbility
@@ -33,8 +33,8 @@
Column("active", Boolean, nullable=True),
Column("amount", Integer, nullable=False),
Column("projected", Boolean, default=False),
Column("created", DateTime, nullable=True, default=func.now()),
Column("modified", DateTime, nullable=True, onupdate=func.now())
Column("created", DateTime, nullable=True, default=datetime.datetime.now),
Column("modified", DateTime, nullable=True, onupdate=datetime.datetime.now)
)

fighter_abilities_table = Table("fightersAbilities", saveddata_meta,

0 comments on commit 216d29c

Please sign in to comment.
You can’t perform that action at this time.