Skip to content
Snippets Groups Projects

Resolve "Image creation bugs with 0 size windows"

Closed Raphael Sturgis requested to merge 21-image-creation-bugs-with-0-size-windows into main
1 file
+ 14
1
Compare changes
  • Side-by-side
  • Inline
+ 14
1
@@ -8,6 +8,8 @@ import os
from pathlib import Path
from configparser import ConfigParser
import psycopg2
def get_config_file():
"""
@@ -58,6 +60,7 @@ def get_data_path():
.format(data_path, config_file))
return data_path
def get_db_config():
"""
Read db config from user configuration file.
@@ -82,4 +85,14 @@ def get_db_config():
if not dict:
raise Exception('Invalid data path: {}. Update configuration file {}'
.format(dict, config_file))
return dict
\ No newline at end of file
return dict
def get_db_connection():
db_config = get_db_config()
connection = psycopg2.connect(user=db_config['user'],
password=db_config['password'],
host=db_config['host'],
port=db_config['port'],
database=db_config['database'])
return connection
Loading