first re-commit.
This commit is contained in:
21
pigpio-master/DOC/bin/updatesql.py
Normal file
21
pigpio-master/DOC/bin/updatesql.py
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sqlite3
|
||||
import glob
|
||||
|
||||
db=sqlite3.connect("dbase/pigpio.sqlite")
|
||||
|
||||
c=db.cursor()
|
||||
|
||||
for fn in glob.glob("tmp/body/*.body"):
|
||||
f = open(fn, encoding='utf-8')
|
||||
body = f.read()
|
||||
f.close()
|
||||
c.execute("UPDATE pigpio SET body=? WHERE file_name=?", (body, fn[9:-5]))
|
||||
|
||||
c.close()
|
||||
|
||||
db.commit()
|
||||
|
||||
db.close()
|
||||
|
Reference in New Issue
Block a user