mirror of
https://git.securmail.fr/gizmo/python-module-pgsql.git
synced 2024-12-22 08:24:41 +01:00
FIX module
This commit is contained in:
parent
0810e4cfbb
commit
f395cf2012
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
config/conf.ini
|
12
README.md
Normal file
12
README.md
Normal 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
14
check_conn.py
Normal 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()
|
|
@ -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)
|
||||||
|
|
BIN
manage_psql/__pycache__/__init__.cpython-36.pyc
Normal file
BIN
manage_psql/__pycache__/__init__.cpython-36.pyc
Normal file
Binary file not shown.
BIN
manage_psql/__pycache__/manage_psql.cpython-36.pyc
Normal file
BIN
manage_psql/__pycache__/manage_psql.cpython-36.pyc
Normal file
Binary file not shown.
Loading…
Reference in a new issue