fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make title results first
[wolnelektury.git]
/
apps
/
search
/
index.py
diff --git
a/apps/search/index.py
b/apps/search/index.py
index
66a7b34
..
822429e
100644
(file)
--- a/
apps/search/index.py
+++ b/
apps/search/index.py
@@
-93,7
+93,8
@@
class Snippets(object):
def close(self):
"""Close snippet file"""
def close(self):
"""Close snippet file"""
- self.file.close()
+ if self.file:
+ self.file.close()
def remove(self):
self.revision = None
def remove(self):
self.revision = None
@@
-829,11
+830,10
@@
class Search(SolrIndex):
idx += 1
except IOError, e:
idx += 1
except IOError, e:
- log.error("Cannot open snippet file for book id = %d [rev=%
d
], %s" % (book_id, revision, e))
+ log.error("Cannot open snippet file for book id = %d [rev=%
s
], %s" % (book_id, revision, e))
return []
finally:
return []
finally:
- if snippets:
- snippets.close()
+ snippets.close()
# remove verse end markers..
snips = map(lambda s: s and s.replace("/\n", "\n"), snips)
# remove verse end markers..
snips = map(lambda s: s and s.replace("/\n", "\n"), snips)