X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FFileStorage.py;h=4f0c337c434d2a9fe5f92bc2ff20f2a1fbfabc46;hb=32a79368fc76b7acc9af2c3c9d428f373d45eac2;hp=af19c9d0a69360573eef5b42ec3bffefb86c85fd;hpb=a91000fb43245ac0585c5f509878fb4c8a47f221;p=nqaap diff --git a/src/FileStorage.py b/src/FileStorage.py index af19c9d..4f0c337 100644 --- a/src/FileStorage.py +++ b/src/FileStorage.py @@ -88,8 +88,13 @@ class FileStorage(object): for book in os.listdir(books_path): book_file = os.path.join(books_path, book) with open(book_file, 'r') as f: - chapter = int(f.readline()) - position = int(f.readline()) + try: + chapter = int(f.readline()) + position = int(f.readline()) + except ValueError: + _moduleLogger.exception("Trouble loading old settings from %s" % book_file) + chapter = 0 + position = 0 self._books[book] = { "chapter": chapter, "position": position,