#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Psql connection module.""" # /* # * ---------------------------------------------------------------------------- # * "THE BEER-WARE LICENSE" (Revision 42): # * wrote this file. As long as you retain this notice you # * can do whatever you want with this stuff. If we meet some day, and you think # * this stuff is worth it, you can buy me a beer in return Boris Tassou # * ---------------------------------------------------------------------------- # */ import sys from configparser import ConfigParser # Global name __version__ = '1.0' __author__ = 'Boris Tassou ' __license__ = 'Beerware' try: import psycopg2 except ImportError: print('Psycopg2 library not found. Books-shelf cannot start.') sys.exit(1) try: INI_CONF = "./config/conf.ini" CONFIG = ConfigParser() CONFIG.read(INI_CONF) except CONFIG.Error as error: print(error) sys.exit(1)