Example #1
0
 def loadDatabaseDefaults(self, event):
     # Import values that must exist otherwise Pyfa breaks
     DefaultDatabaseValues.importRequiredDefaults()
     # Import default values for damage profiles
     DefaultDatabaseValues.importDamageProfileDefaults()
     # Import default values for target resist profiles
     DefaultDatabaseValues.importResistProfileDefaults()
Example #2
0
 def loadDatabaseDefaults(self, event):
     # Import values that must exist otherwise Pyfa breaks
     DefaultDatabaseValues.importRequiredDefaults()
     # Import default values for damage profiles
     DefaultDatabaseValues.importDamageProfileDefaults()
     # Import default values for target resist profiles
     DefaultDatabaseValues.importTargetProfileDefaults()
Example #3
0
pyfalog = Logger(__name__)

# Make sure the saveddata db exists
if config.savePath and not os.path.exists(config.savePath):
    os.mkdir(config.savePath)

if config.saveDB and os.path.isfile(config.saveDB):
    # If database exists, run migration after init'd database
    pyfalog.debug("Run database migration.")
    db.saveddata_meta.create_all()
    migration.update(db.saveddata_engine)
    # Import default database values
    # Import values that must exist otherwise Pyfa breaks
    pyfalog.debug("Import Required Database Values.")
    DefaultDatabaseValues.importRequiredDefaults()

    # Finds and fixes database corruption issues.
    pyfalog.debug("Starting database validation.")
    database_cleanup_instance = DatabaseCleanup()
    database_cleanup_instance.OrphanedCharacterSkills(db.saveddata_engine)
    database_cleanup_instance.OrphanedFitCharacterIDs(db.saveddata_engine)
    database_cleanup_instance.OrphanedFitDamagePatterns(db.saveddata_engine)
    database_cleanup_instance.NullDamagePatternNames(db.saveddata_engine)
    database_cleanup_instance.NullTargetResistNames(db.saveddata_engine)
    database_cleanup_instance.OrphanedFitIDItemID(db.saveddata_engine)
    database_cleanup_instance.NullDamageTargetPatternValues(
        db.saveddata_engine)
    database_cleanup_instance.DuplicateSelectedAmmoName(db.saveddata_engine)
    pyfalog.debug("Completed database validation.")
Example #4
0
# to include modified pyfa.py, this is the best place to put it. See GH issue
# #176
# @ todo: move this to pyfa.py
########

#Make sure the saveddata db exists
if not os.path.exists(config.savePath):
    os.mkdir(config.savePath)

if os.path.isfile(config.saveDB):
    # If database exists, run migration after init'd database
    eos.db.saveddata_meta.create_all()
    migration.update(eos.db.saveddata_engine)
    # Import default database values
    # Import values that must exist otherwise Pyfa breaks
    DefaultDatabaseValues.importRequiredDefaults()

    logging.debug("Starting database validation.")
    database_cleanup_instance = DatabaseCleanup()
    database_cleanup_instance.OrphanedCharacterSkills(eos.db.saveddata_engine)
    database_cleanup_instance.OrphanedFitCharacterIDs(eos.db.saveddata_engine)
    database_cleanup_instance.OrphanedFitDamagePatterns(eos.db.saveddata_engine)
    logging.debug("Completed database validation.")

else:
    # If database does not exist, do not worry about migration. Simply
    # 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
    # Import values that must exist otherwise Pyfa breaks