diff --git a/database/actions.py b/database/actions.py index 8563824fc5be33af513216ba5f938d02f317f2ea..daf1c0352acddbb8cc04f3d88a102f4ee42ca4c3 100644 --- a/database/actions.py +++ b/database/actions.py @@ -50,6 +50,8 @@ def temporary_data(connection, file_name, table, year, offset=2, ttable = table.get_temporary(header, year) ttable.create(bind=connection) + file_name = settings.db_env_file_path(file_name) + print("TESTE: ", file_name) table.populate_temporary(ttable, file_name, header, year, delimiters, null, offset, bind=connection) table.apply_derivatives(ttable, ttable.columns.keys(), year, bind=connection) diff --git a/settings.py b/settings.py index 36dd10f504d092e046af72592e81115e2fe7195c..75a4f5b991cc7341dd29a10985508dae691bcc48 100644 --- a/settings.py +++ b/settings.py @@ -21,19 +21,22 @@ along with HOTMapper. If not, see <https://www.gnu.org/licenses/>. '''Settings used by the database module''' import logging +def db_env_file_path(file_name): + return file_name.replace('glc22', 'monetdb') + # SQL dialect used by sqlalchemy. DATABASE_DIALECT = 'monetdb' # Login credentials in database DATABASE_USER = 'monetdb' -DATABASE_USER_PASSWORD = 'monetdb' +DATABASE_USER_PASSWORD = '12345' # Host to connect to. Bulk inserts won't work remotely unless you can specify an # absolute path in the server DATABASE_HOST = 'localhost' # Database to connect to -DATABASE = 'hotmapper_demo' +DATABASE = 'treinamento' # Column used to run aggregations and denormalizations YEAR_COLUMN = 'ano_censo'