Skip to content

Commit

Permalink
Merge pull request #25 from Hydrology-IFH/working_tree
Browse files Browse the repository at this point in the history
Working_tree
  • Loading branch information
maxschmi authored Jan 24, 2023
2 parents bddb4c0 + d52a46b commit 794b4b8
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 51 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change-log

## Version 0.0.20
- change secretSettings_weatherDB names to DB_PWD, DB_NAME and DB_USER
- add min and max to the temperature timeseries

## Version 0.0.19
- fix error of updating raw_files table after new import.
- change log file name to weatherDB_%host%_%user%.log
Expand Down
4 changes: 2 additions & 2 deletions weatherDB/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

__author__ = "Max Schmit"
__email__ = "[email protected]"
__copyright__ = "Copyright 2022, Max Schmit"
__version__ = "0.0.19"
__copyright__ = "Copyright 2023, Max Schmit"
__version__ = "0.0.20"

if not ("WEATHERDB_MODULE_INSTALLING" in os.environ \
and os.environ["WEATHERDB_MODULE_INSTALLING"]=="True"):
Expand Down
14 changes: 11 additions & 3 deletions weatherDB/lib/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@
except ImportError:
raise ImportError("The secretSettings_weatherDB.py file was not found on your system.\n Please put the file somewhere on your sys.path directories or add the directory of the file to your sys.path/PYTHONPATH environment variable. For more information see the docs.")

# backwards compatibility of renaming secret values
if hasattr(secrets, "DB_WEA_USER"):
secrets.DB_USER = secrets.DB_WEA_USER
if hasattr(secrets, "DB_WEA_NAME"):
secrets.DB_NAME = secrets.DB_WEA_NAME
if hasattr(secrets, "DB_WEA_PWD"):
secrets.DB_PWD = secrets.DB_WEA_PWD

# create the engine
DB_ENG = sqlalchemy.create_engine(
"postgresql://{user}:{pwd}@{host}:{port}/{name}".format(
user=secrets.DB_WEA_USER,
pwd=secrets.DB_WEA_PWD,
user=secrets.DB_USER,
pwd=secrets.DB_PWD,
host=secrets.DB_HOST,
name=secrets.DB_WEA_NAME,
name=secrets.DB_NAME,
port=secrets.DB_PORT
)
)
Expand Down
Loading

0 comments on commit 794b4b8

Please sign in to comment.