Skip to content
Permalink
Browse files

Merge remote-tracking branch 'remotes/pyfa-org/master' into catchup_m…

…aster

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

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