Ejemplo n.º 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()
Ejemplo n.º 2
0
 def loadDatabaseDefaults(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()
Ejemplo n.º 3
0
    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.")

else:
    # If database does not exist, do not worry about migration. Simply
    # create and set version
    pyfalog.debug("Existing database not found, creating new database.")
    db.saveddata_meta.create_all()
    db.saveddata_engine.execute('PRAGMA user_version = {}'.format(
        migration.getAppVersion()))
    # Import default database values
    # 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()
Ejemplo n.º 4
0
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
    DefaultDatabaseValues.importRequiredDefaults()
    # Import default values for damage profiles
    DefaultDatabaseValues.importDamageProfileDefaults()
    # Import default values for target resist profiles
    DefaultDatabaseValues.importResistProfileDefaults()