Merge branch 'default-database-profiles' of git://github.com/Ebag333/Pyfa
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
import eos.db
|
||||
import eos.types
|
||||
import eos.db.saveddata.loadDefaultDatabaseValues as loadDefaultDatabaseValues
|
||||
import copy
|
||||
|
||||
class ImportError(Exception):
|
||||
@@ -35,10 +36,9 @@ class DamagePattern():
|
||||
|
||||
def __init__(self):
|
||||
uniform = eos.db.getDamagePattern("Uniform")
|
||||
importDBDefaults = loadDefaultDatabaseValues.defaultDatabaseValues()
|
||||
if uniform is None:
|
||||
uniform = eos.types.DamagePattern(25, 25, 25, 25)
|
||||
uniform.name = "Uniform"
|
||||
eos.db.save(uniform)
|
||||
importDBDefaults.importRequiredDefaults()
|
||||
|
||||
def getDamagePatternList(self):
|
||||
return eos.db.getDamagePatternList()
|
||||
@@ -96,4 +96,3 @@ class DamagePattern():
|
||||
|
||||
patterns.sort(key=lambda p: p.name)
|
||||
return eos.types.DamagePattern.exportPatterns(*patterns)
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import config
|
||||
import os
|
||||
import eos.types
|
||||
import eos.db.migration as migration
|
||||
import eos.db.saveddata.loadDefaultDatabaseValues as loadDefaultDatabaseValues
|
||||
|
||||
class PrefetchThread(threading.Thread):
|
||||
def run(self):
|
||||
@@ -56,3 +57,12 @@ else:
|
||||
# create and set version
|
||||
eos.db.saveddata_meta.create_all()
|
||||
eos.db.saveddata_engine.execute('PRAGMA user_version = {}'.format(migration.getAppVersion()))
|
||||
#Import default database values
|
||||
importDBDefaults = loadDefaultDatabaseValues.defaultDatabaseValues()
|
||||
#Import values that must exist otherwise Pyfa breaks
|
||||
importDBDefaults.importRequiredDefaults()
|
||||
#Import default values for damage profiles
|
||||
importDBDefaults.importDamageProfileDefaults()
|
||||
#Import default values for target resist profiles
|
||||
importDBDefaults.importResistProfileDefaults()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user