mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-12-15 15:03:58 +01:00
Import cards from JendaSAP list (nick UID list)
This commit is contained in:
parent
4256abe449
commit
9385a3749e
2 changed files with 62 additions and 8 deletions
|
|
@ -9,14 +9,10 @@ Give filename as first argument.
|
|||
import sys
|
||||
import sqlite3
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print >> sys.stderr, "You must specify filename as arg1 where the DB is to be created"
|
||||
|
||||
filename = sys.argv[1]
|
||||
conn = sqlite3.connect(filename)
|
||||
cursor = conn.cursor()
|
||||
|
||||
def createTables(cursor):
|
||||
"""Create DB tables in an empty database
|
||||
@:param cursor cursor to sqlite DB
|
||||
"""
|
||||
cursor.execute("""CREATE TABLE authorized_uids(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
uid_hex TEXT,
|
||||
|
|
@ -33,5 +29,15 @@ if __name__ == "__main__":
|
|||
uid_hex TEXT,
|
||||
nick TEXT)
|
||||
""")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print >> sys.stderr, "You must specify filename as arg1 where the DB is to be created"
|
||||
|
||||
filename = sys.argv[1]
|
||||
conn = sqlite3.connect(filename)
|
||||
cursor = conn.cursor()
|
||||
createTables(cursor)
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue