FIX module

This commit is contained in:
Boris Tassou 2019-12-03 16:47:41 +01:00
parent 0810e4cfbb
commit f395cf2012
7 changed files with 33 additions and 6 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
config/conf.ini

12
README.md Normal file
View File

@ -0,0 +1,12 @@
## Manage PgSQL
Module for python3 only.
### Import and use
```
from manage_psql.manage_psql import HandlePsql
MY_PSQL_CONN = HandlePsql()
MY_PSQL_CONN.psql_checkcon()
```

14
check_conn.py Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from manage_psql.manage_psql import HandlePsql
MY_PSQL_CONN = HandlePsql()
MY_PSQL_CONN.psql_conn()
print("PgSQL conncetion")
STATE_CONN = MY_PSQL_CONN.psql_checkcon()
print("PgSQL connection status : {}".format(STATE_CONN))
print("PgSQL deconnection")
MY_PSQL_CONN.psql_unconn()

View File

@ -26,9 +26,9 @@ except ImportError:
sys.exit(1)
try:
ini_conf = "./config/conf.ini"
config = SafeConfigParser()
config.read(ini_conf)
except config.Error as error:
print(error)
sys.exit(1)
INI_CONF = "./config/conf.ini"
CONFIG = SafeConfigParser()
CONFIG.read(INI_CONF)
except CONFIG.Error as error:
print(error)
sys.exit(1)

Binary file not shown.

Binary file not shown.