projects
/
nqaap
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a91000f
)
making loading old settings more resilient
author
Ed Page
<eopage@byu.net>
Wed, 12 Jan 2011 03:54:38 +0000
(21:54 -0600)
committer
Ed Page
<eopage@byu.net>
Wed, 12 Jan 2011 03:54:38 +0000
(21:54 -0600)
src/FileStorage.py
patch
|
blob
|
history
diff --git
a/src/FileStorage.py
b/src/FileStorage.py
index
af19c9d
..
4f0c337
100644
(file)
--- 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:
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,
self._books[book] = {
"chapter": chapter,
"position": position,