|
a/webui.py |
|
b/webui.py |
|
... |
|
... |
20 |
# recoll settings
|
20 |
# recoll settings
|
21 |
RECOLL_CONFS = [ '~/.recoll/recoll.conf', '/etc/recoll.conf' ]
|
21 |
RECOLL_CONFS = [ '~/.recoll/recoll.conf', '/etc/recoll.conf' ]
|
22 |
|
22 |
|
23 |
# settings defaults
|
23 |
# settings defaults
|
24 |
DEFAULTS = {
|
24 |
DEFAULTS = {
|
25 |
'prefix': 'z:/',
|
|
|
26 |
'context': 30,
|
25 |
'context': 30,
|
27 |
'stem': 1,
|
26 |
'stem': 1,
|
28 |
'timefmt': '%c',
|
27 |
'timefmt': '%c',
|
29 |
'dirdepth': 3,
|
28 |
'dirdepth': 3,
|
30 |
'maxchars': 500,
|
29 |
'maxchars': 500,
|
|
... |
|
... |
202 |
query = get_query()
|
201 |
query = get_query()
|
203 |
qs = query_to_recoll_string(query)
|
202 |
qs = query_to_recoll_string(query)
|
204 |
res, timer = recoll_search(qs, query['sort'], query['ascending'])
|
203 |
res, timer = recoll_search(qs, query['sort'], query['ascending'])
|
205 |
return { 'res': res, 'time': timer, 'query': query, 'dirs':
|
204 |
return { 'res': res, 'time': timer, 'query': query, 'dirs':
|
206 |
get_dirs(config['dirs'], config['dirdepth']),'qs': qs, 'sorts': SORTS, 'config': config,
|
205 |
get_dirs(config['dirs'], config['dirdepth']),'qs': qs, 'sorts': SORTS, 'config': config,
|
207 |
'query_string': bottle.request.query_string, 'roots': config['dirs'] }
|
206 |
'query_string': bottle.request.query_string }
|
208 |
#}}}
|
207 |
#}}}
|
209 |
#{{{ json
|
208 |
#{{{ json
|
210 |
@bottle.route('/json')
|
209 |
@bottle.route('/json')
|
211 |
def get_json():
|
210 |
def get_json():
|
212 |
query = get_query()
|
211 |
query = get_query()
|