notebookVB
This commit is contained in:
4
05 testik.py
Normal file
4
05 testik.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import socket
|
||||||
|
|
||||||
|
computer_name = socket.gethostname()
|
||||||
|
print(computer_name)
|
||||||
16
functions.py
16
functions.py
@@ -13,13 +13,8 @@ import pymysql
|
|||||||
from pymysql.cursors import DictCursor
|
from pymysql.cursors import DictCursor
|
||||||
import fdb
|
import fdb
|
||||||
|
|
||||||
MEDICUS_CFG = dict(
|
|
||||||
dsn=r"192.168.1.4:z:\medicus 3\data\medicus.fdb",
|
|
||||||
user="SYSDBA",
|
|
||||||
password="masterkey",
|
|
||||||
charset="win1250",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
import socket
|
||||||
def get_medicus_connection():
|
def get_medicus_connection():
|
||||||
"""
|
"""
|
||||||
Attempt to create a Firebird connection to the Medicus database.
|
Attempt to create a Firebird connection to the Medicus database.
|
||||||
@@ -27,6 +22,15 @@ def get_medicus_connection():
|
|||||||
fdb.Connection object on success
|
fdb.Connection object on success
|
||||||
None on failure
|
None on failure
|
||||||
"""
|
"""
|
||||||
|
if socket.gethostname().strip()=="NTBVBHP470G10":
|
||||||
|
MEDICUS_CFG = dict(
|
||||||
|
dsn=r"192.168.1.4:z:\medicus 3\data\medicus.fdb",
|
||||||
|
user="SYSDBA",
|
||||||
|
password="masterkey",
|
||||||
|
charset="win1250",
|
||||||
|
)
|
||||||
|
elif:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return fdb.connect(**MEDICUS_CFG)
|
return fdb.connect(**MEDICUS_CFG)
|
||||||
except fdb.fbcore.DatabaseError as e:
|
except fdb.fbcore.DatabaseError as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user