-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.py
More file actions
41 lines (28 loc) · 961 Bytes
/
Example.py
File metadata and controls
41 lines (28 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import sys
from utilities.constants import *
from utilities.DatabaseClass import *
from utilities.exceptions import *
from utilities.GenConfigFile import ConfigFile
# from searches.SearchTable1 import *
from searches import SearchTable2
from searches import SerchValues
parameters = sys.argv[1:]
profile = parameters[0]
conf = ConfigFile(Profiles[profile].value)
table2Id = 1
instData = pd.DataFrame({'name': ['Bernardo', 'Felipe', 'Fred', 'Gustavo', 'Vinicius'] })
try:
db = DatabaseClass('CONFIG_SECTION',conf)
except Exception as eDb:
exceptionTreatment(eDb)
try:
data = instData.to_dict('index')
if (isinstance(db, DatabaseClass)):
kpiExec = db.connectDb(newDatabase=True)
repo = SearchTable2.Table2Search(db)
repo2 = SerchValues.ValuesSearch(db)
repo.setData(instData)
print(repo.getAll())
db.closeSession()
except Exception as e:
exceptionTreatment(e)