Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
count = self.docsearch.index.start_examine_rootdir()
progress = 0
while True:
(status, doc) = self.docsearch.index.continue_examine_rootdir()
if status == 'end':
break
elif status == 'modified':
on_doc_modified(doc)
elif status == 'unchanged':
on_doc_unchanged(doc)
elif status == 'new':
on_new_doc(doc)
progress_cb(progress, count,
DocSearch.INDEX_STEP_CHECKING, doc)
progress += 1
while True:
(status, doc) = self.docsearch.index.continue_examine_rootdir2()
if status == 'end':
break
on_doc_deleted(doc)
progress_cb(1, 1, DocSearch.INDEX_STEP_CHECKING)
self.docsearch.index.end_examine_rootdir()
def get_docsearch():
pconfig = config.PaperworkConfig()
pconfig.read()
verbose("Work directory: {}".format(pconfig.settings['workdir'].value))
dsearch = docsearch.DocSearch(pconfig.settings['workdir'].value)
dsearch.reload_index()
return dsearch