diff options
author | Florent Pigout <florent.pigout@gmail.com> | 2011-10-14 09:46:55 (GMT) |
---|---|---|
committer | Florent Pigout <florent.pigout@gmail.com> | 2011-10-14 09:46:55 (GMT) |
commit | b983e2b7cc9373f8566fd00013ab3381ca2c2b7b (patch) | |
tree | d8464172a0efd9f0f762b12a27f603f6657afa09 | |
parent | e18ec5cc5456301a4fad1f14fb4cf98052fa7a8f (diff) |
use new key db [TODO - reimplement sound management]
-rw-r--r-- | atoidejouer/db/story.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/atoidejouer/db/story.py b/atoidejouer/db/story.py index 032dff6..fd937f5 100644 --- a/atoidejouer/db/story.py +++ b/atoidejouer/db/story.py @@ -102,13 +102,11 @@ class DB(object): def __check(self): cur = self.con.cursor() - cur.execute( - "select count(*) from sqlite_master where name=?", - (self.name,) - ) # remove all first - if cur.fetchone(): + try: cur.execute("drop table %s" % self.name) + except Exception, e: + pass # create fresh db cur.execute(self.obj().create()) # and close |