aboutsummaryrefslogtreecommitdiffstats
path: root/python/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/common.py')
-rw-r--r--python/common.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/python/common.py b/python/common.py
index 07d44a29..f34e3efc 100644
--- a/python/common.py
+++ b/python/common.py
@@ -1,32 +1,6 @@
import os
-import psycopg2
if os.name =='nt':
root = "//WDsentinel/share/CorpCDOs"
elif os.name == 'posix':
root = '/home/share/CorpCDOs'
-
-conn = psycopg2.connect(database="ET",
- user="et_user",
- password="Serenitas1",
- host="debian")
-
-def query_db(conn, sqlstr, **kwargs):
-
- params = kwargs.get('params', None)
- one = kwargs.get('one', True)
- try:
- c = conn.cursor()
- if params:
- c.execute(sqlstr, params)
- else:
- c.execute(sqlstr)
- if one:
- return c.fetchone()
- else:
- return c.fetchall()
- c.close()
- except psycopg2.Error:
- c.close()
- conn.rollback()
- return None