Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Francois Dockes
recoll-webui
Commits
1f91a59a
Commit
1f91a59a
authored
Jul 09, 2013
by
Jean-Francois Dockes
Browse files
recoll 1.19 compatibility changes
parent
740f507c
Changes
3
Hide whitespace changes
Inline
Side-by-side
views/result.tpl
View file @
1f91a59a
...
...
@@ -11,7 +11,7 @@
%if len(d['ipath']) > 0:
<div
class=
"search-result-ipath"
>
[{
{
d
[
'ipath'
]
}
}]
</div>
%end
%if len(d['author']) > 0:
%if
d.has_key('author') and
len(d['author']) > 0:
<div
class=
"search-result-author"
>
{
{
d
[
'author'
]
}
}
</div>
%end
<div
class=
"search-result-url"
>
...
...
webui-standalone.py
View file @
1f91a59a
#!env python
#!
/usr/bin/
env python
import
bottle
import
webui
...
...
webui.py
View file @
1f91a59a
...
...
@@ -3,7 +3,11 @@
import
os
import
bottle
import
time
import
recoll
try
:
from
recoll
import
recoll
except
:
import
recoll
import
datetime
import
glob
import
hashlib
...
...
@@ -184,12 +188,23 @@ def recoll_search(q):
config
[
'perpage'
]
=
nres
q
[
'page'
]
=
1
offset
=
(
q
[
'page'
]
-
1
)
*
config
[
'perpage'
]
query
.
next
=
offset
while
query
.
next
>=
0
and
query
.
next
<
offset
+
config
[
'perpage'
]
and
query
.
next
<
nres
:
doc
=
query
.
fetchone
()
if
type
(
query
.
next
)
==
int
:
query
.
next
=
offset
else
:
query
.
scroll
(
offset
)
for
i
in
range
(
config
[
'perpage'
]):
try
:
doc
=
query
.
fetchone
()
except
:
break
d
=
{}
for
f
in
FIELDS
:
d
[
f
]
=
getattr
(
doc
,
f
).
encode
(
'utf-8'
)
v
=
getattr
(
doc
,
f
)
if
v
is
not
None
:
d
[
f
]
=
v
.
encode
(
'utf-8'
)
else
:
d
[
f
]
=
''
d
[
'label'
]
=
select
([
d
[
'title'
],
d
[
'filename'
],
'?'
],
[
None
,
''
])
d
[
'sha'
]
=
hashlib
.
sha1
(
d
[
'url'
]
+
d
[
'ipath'
]).
hexdigest
()
d
[
'time'
]
=
timestr
(
d
[
'mtime'
],
config
[
'timefmt'
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment