21 lines
323 B
Python
21 lines
323 B
Python
if __name__ != "__main__":
|
|
print("This is not a module")
|
|
exit()
|
|
|
|
import sys
|
|
import sqlite3
|
|
|
|
if len(sys.argv) < 2:
|
|
print("Missing database import file")
|
|
exit()
|
|
|
|
sql = sqlite3.connect("wayback.db")
|
|
cur = sql.cursor()
|
|
|
|
with open(sys.argv[1], "r") as f:
|
|
cur.executescript( f.read() )
|
|
|
|
sql.commit()
|
|
|
|
cur.close()
|
|
sql.close() |