lesana.collection module¶
-
class
lesana.collection.
Collection
(directory=None, itemdir='items')[source]¶ Bases:
object
-
PARSER_FLAGS
= 23¶
-
property
indexed_fields
¶
-
classmethod
init
(directory=None, git_enabled=True, edit_file=None, settings={})[source]¶ Initialize a lesana repository
directory defaults to . if git_enabled is True, git support is enabled and if possible a git repository is initalized. edit_file is a syncronous function that runs on a filename (possibly opening the file in an editor) and should manage its own errors.
-
update_cache
(fnames=None, reset=False)[source]¶ Update the xapian db with the data in files.
fnames
is a list of basenames of files inself.itemdir
.If no files have been passed, add everything.
if
reset
the existing xapian db is deleted before indexingReturn the number of files that have been added to the cache.
-