minor code cleanup

This commit is contained in:
Lynnesbian 2020-03-08 19:46:07 +10:00
parent d698cd445a
commit 7d718bbe3a
No known key found for this signature in database
GPG key ID: F0A184B5213D9F90
3 changed files with 11 additions and 9 deletions

View file

@ -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):