Commit 48adbfd8 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Simplify things a bit by getting rid of the hasrclextract variable, dropping...

Simplify things a bit by getting rid of the hasrclextract variable, dropping support for pre-1.19 recoll
parent 1cf021c0
......@@ -33,9 +33,7 @@
<div class="search-result-links">
<a href="{{url}}">Open</a>
<a href="download/{{number-1}}?{{query_string}}">Download</a>
%if hasrclextract:
<a href="preview/{{number-1}}?{{query_string}}" target="_blank">Preview</a>
%end
</div>
<div class="search-result-date">{{d['time']}}</div>
<div class="search-result-snippet">{{!d['snippet']}}</div>
......
......@@ -16,7 +16,7 @@
%include('pages', query=query, config=config, nres=nres)
<div id="results">
%for i in range(0, len(res)):
%include('result', d=res[i], i=i, query=query, config=config, query_string=query_string, hasrclextract=hasrclextract)
%include('result', d=res[i], i=i, query=query, config=config, query_string=query_string)
%end
</div>
%include('pages', query=query, config=config, nres=nres)
......
......@@ -22,15 +22,7 @@ else: # 2.x
import urllib
# import recoll and rclextract
try:
from recoll import recoll
from recoll import rclextract
hasrclextract = True
except Exception as err:
msg("Import recoll because: %s" % err)
import recoll
hasrclextract = False
# Import rclconfig system-wide or local copy
from recoll import recoll,rclextract
try:
from recoll import rclconfig
except:
......@@ -293,16 +285,14 @@ def results():
if config['perpage'] == 0:
config['perpage'] = nres
return { 'res': res, 'time': timer, 'query': query, 'dirs':
get_dirs(config['dirs'], config['dirdepth']),
get_dirs(config['dirs'], config['dirdepth']),
'qs': qs, 'sorts': SORTS, 'config': config,
'query_string': bottle.request.query_string, 'nres': nres,
'hasrclextract': hasrclextract, 'config': config}
'query_string': bottle.request.query_string, 'nres': nres,
'config': config}
#}}}
#{{{ preview
@bottle.route('/preview/<resnum:int>')
def preview(resnum):
if not hasrclextract:
return 'Sorry, needs recoll version 1.19 or later'
query = get_query()
qs = query_to_recoll_string(query)
rclq = recoll_initsearch(query)
......@@ -321,8 +311,6 @@ def preview(resnum):
#{{{ download
@bottle.route('/download/<resnum:int>')
def edit(resnum):
if not hasrclextract:
return 'Sorry, needs recoll version 1.19 or later'
query = get_query()
qs = query_to_recoll_string(query)
rclq = recoll_initsearch(query)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment