-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransaction.py
More file actions
25 lines (22 loc) · 833 Bytes
/
Copy pathTransaction.py
File metadata and controls
25 lines (22 loc) · 833 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
import re
from termcolor import colored
import Parse as prs
import QueryProcessor as qp
class Transaction:
def __init__(self,database,queryProcessor):
self.database=database
self.queryProcessor=queryProcessor
def beginTransaction(self):
print("\n--------------------------------------------------------")
print("tranasction started")
query = ""
while not query.lower() == "quit":
query=input()
query_type = prs.Parse(self.database,query,self.queryProcessor)
val = query_type.check_query()
if val == -1:
print(colored("Incorrect Query",'red'))
elif val == 0:
break
print("transaction ended")
print("\n--------------------------------------------------------")