Created
October 11, 2019 18:23
-
-
Save FBosler/c001ed47cfcdd6b05a213d392c6d285f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import yaml as _yaml | |
import logging | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
def get_config(): | |
config_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'production.yml') | |
try: | |
with open(config_path) as config_file: | |
return _yaml.load(config_file) | |
except FileNotFoundError: | |
logger.error(f'You probably forgot to create a production.yml, as we could not find {config_path}') | |
raise | |
def get_post_data(): | |
data_path = os.path.join(os.path.dirname(__file__), '..', 'config', 'post_data.yml') | |
with open(data_path) as config_file: | |
return _yaml.load(config_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment