How to use the paperwork-backend.paperwork_backend.docsearch.DocSearch function in paperwork-backend

To help you get started, we’ve selected a few paperwork-backend examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openpaperwork / paperwork / paperwork-backend / paperwork_backend / docsearch.py View on Github external
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()
github openpaperwork / paperwork / paperwork-backend / paperwork_backend / shell.py View on Github external
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