Skip to content

Commit 81f2150

Browse files
committed
First commit of mOOZmar
1 parent ad2c1ae commit 81f2150

24 files changed

+16243
-0
lines changed

Anbar.py

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import mysql.connector as mysql
2+
3+
4+
class Anbar:
5+
6+
db=mysql.connect( host = "localhost", user = "d2", passwd = "22111357")
7+
cursor = db.cursor()
8+
def __init__(self):
9+
pass
10+
def begir(self,arg):
11+
try:
12+
self.cursor.execute(arg)
13+
return self.cursor.fetchall() ## it returns a list of all databases present
14+
except Exception as e:
15+
print (e)
16+
return
17+
pass
18+
def getCurrencyID(self,arg):
19+
self.begir("use price_db")
20+
stmt=" select id from Jens where code='{}' limit 1;".format(arg)
21+
print (stmt)
22+
try:
23+
return self.begir(stmt)[0][0]
24+
except :
25+
return -1
26+
def getSrcID(self,srcurl):
27+
#Extract domain name
28+
#root=Khadang,getRoot(srcurl)
29+
#self.begir("use price_db")
30+
#stmt=" select id from Sources where name='{}' limit 1;".format(root)
31+
#print (stmt)
32+
#try:
33+
#return self.begir(stmt)[0][0]
34+
35+
def getRosetaByURL(self,cursor,url):
36+
#cursor.excute("select ID from Sources")
37+
#ros=cursor.fetchall()
38+
return ""
39+
def bezar

Anbar.pyc

1.53 KB
Binary file not shown.

0 commit comments

Comments
 (0)