Exemplo n.º 1
0
#!/usr/bin/python

import MySQLdb
import members

db = MySQLdb.connect(user='******', passwd='g34Api5C9L', host='127.0.0.1', db='internal', charset='utf8')

try:
    new_member_ids = members.generate(db, 100)
    db.commit()
except:
    db.rollback()
    raise 

db.close()

Exemplo n.º 2
0
#!/usr/bin/python

import MySQLdb
import members
import member_rfid

db = MySQLdb.connect(user='******', passwd='g34Api5C9L', host='127.0.0.1', db='internal', charset='utf8')

try:
    report = []
    new_members = members.generate(db, report, 1000)
    member_rfid.generate(db, report, new_members)
    db.commit()

    print "Done!\n"
    print "Special test cases generated:"
    for report_line in report:
        print "%s: %s" % (report_line[1].civicregno, report_line[0])
except:
    db.rollback()
    raise 

db.close()