minor code cleanup
This commit is contained in:
parent
d698cd445a
commit
7d718bbe3a
3 changed files with 11 additions and 9 deletions
3
main.py
3
main.py
|
@ -83,6 +83,7 @@ db = sqlite3.connect("toots.db")
|
|||
db.text_factory=str
|
||||
c = db.cursor()
|
||||
c.execute("CREATE TABLE IF NOT EXISTS `toots` (sortid INTEGER UNIQUE PRIMARY KEY AUTOINCREMENT, id VARCHAR NOT NULL, cw INT NOT NULL DEFAULT 0, userid VARCHAR NOT NULL, uri VARCHAR NOT NULL, content VARCHAR NOT NULL)")
|
||||
db.commit()
|
||||
|
||||
tableinfo = c.execute("PRAGMA table_info(`toots`)").fetchall()
|
||||
found = False
|
||||
|
@ -116,7 +117,7 @@ if not found:
|
|||
|
||||
c.execute("DROP TABLE `toots`")
|
||||
c.execute("ALTER TABLE `toots_temp` RENAME TO `toots`")
|
||||
|
||||
|
||||
db.commit()
|
||||
|
||||
def handleCtrlC(signal, frame):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue