5
0
Fork 0
mirror of https://git.securmail.fr/gizmo/python-module-pgsql.git synced 2024-12-22 03:24:42 +01:00

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) sys.exit(1)
try: try:
ini_conf = "./config/conf.ini" INI_CONF = "./config/conf.ini"
config = SafeConfigParser() CONFIG = SafeConfigParser()
config.read(ini_conf) CONFIG.read(INI_CONF)
except config.Error as error: except CONFIG.Error as error:
print(error) print(error)
sys.exit(1) sys.exit(1)

Binary file not shown.

Binary file not shown.