예제 #1
0
    def insert(self):
        self.myevalx = donorValidate()
        myvals = {'Name':"TEXT",'Phone':"TEXT",'Hash':'TEXT'}
        myDon = Databasing('revolution.db',myvals)
        a = myDon.write(self.myevalx.get())
#        a=0
        if a==0:
            print 'Thank u thank u, keep up the hard work'
        elif a==2:
            print 'Do u like to waste msgs???!! Keep them for ur gf/bf'
        print myDon.read()
예제 #2
0
while 1:
#    os.system("wget http://geek-tronics.com/cgi-bin/txtweb/sjce.db")
    os.system("GET http://geek-tronics.com/cgi-bin/txtweb/sjce.py > databaselist.txt")
    
    PORT = 0
    BAUD = 9600
    
    f = open('databaselist.txt')
    zsd = f.read()
    zsd = zsd.split('\n')
    
    
    ser = serial.Serial('/dev/ttyACM'+str(PORT), BAUD,timeout=1)
    xxx = {'txtWebId':'TEXT' , 'hash':'TEXT', 'verifyId':'TEXT', 'msg':'TEXT'}
    form = cgi.FieldStorage()
    deldb = form.getvalue('deletedb')
    mydb = Databasing('sjce.db',xxx)
    if deldb==1 or deldb=='1':
        mydb = Databasing('sjce.db',xxx,'w')
    data  = mydb.read(-1,['msg'])
    for i in zsd:
        if i == '':
            continue
        if 'on' in i:
            ser.write(1)
        else :
            ser.write(0)
        time.sleep(5)
        print i

예제 #3
0
from Databasing import Databasing
mydb = Databasing('forceNumber.db',{'Name':'TEXT','Phone':'TEXT','Level':'INT'},'w')
f = open('contacts.csv','r')
data=f.read()
data = data.replace('\t','')
data= data.split('\n')
for i in range(len(data)):
    data[i] = data[i].split(':')
    
for i in data:
    try:
        i[1]
    except:
        break
        
    i[1] = i[1].replace(' ','')
    i[0] = i[0].replace('.',' ')
    cont = {'Name':i[0],'Phone':i[1],'Level':''}
    mydb.write(cont)
mydb.read()