How to use the paperwork.backend.util.strip_accents function in paperwork

To help you get started, we’ve selected a few paperwork 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 / src / paperwork / backend / labels.py View on Github external
def __label_cmp(self, other):
        """
        Comparaison function. Can be used to sort labels alphabetically.
        """
        if other is None:
            return -1
        label_name = strip_accents(self.name).lower()
        other_name = strip_accents(other.name).lower()
        cmp_r = cmp(label_name, other_name)
        if cmp_r != 0:
            return cmp_r
        return cmp(self.get_color_str(), other.get_color_str())
github openpaperwork / paperwork / src / paperwork / backend / labels.py View on Github external
def __label_cmp(self, other):
        """
        Comparaison function. Can be used to sort labels alphabetically.
        """
        if other is None:
            return -1
        label_name = strip_accents(self.name).lower()
        other_name = strip_accents(other.name).lower()
        cmp_r = cmp(label_name, other_name)
        if cmp_r != 0:
            return cmp_r
        return cmp(self.get_color_str(), other.get_color_str())
github openpaperwork / paperwork / src / paperwork / backend / docsearch.py View on Github external
dochash = (u"%X" % dochash)

        doc_txt = doc.get_index_text()
        assert(isinstance(doc_txt, unicode))
        labels_txt = doc.get_index_labels()
        assert(isinstance(labels_txt, unicode))

        query = whoosh.query.Term("docid", docid)
        index_writer.delete_by_query(query)

        index_writer.update_document(
            docid=docid,
            doctype=doc.doctype,
            docfilehash=dochash,
            content=strip_accents(doc.get_index_text()),
            label=strip_accents(doc.get_index_labels()),
            date=doc.date,
            last_read=last_mod
        )
        return True
github openpaperwork / paperwork / src / paperwork / backend / docsearch.py View on Github external
dochash = doc.get_docfilehash()
        dochash = (u"%X" % dochash)

        doc_txt = doc.get_index_text()
        assert(isinstance(doc_txt, unicode))
        labels_txt = doc.get_index_labels()
        assert(isinstance(labels_txt, unicode))

        query = whoosh.query.Term("docid", docid)
        index_writer.delete_by_query(query)

        index_writer.update_document(
            docid=docid,
            doctype=doc.doctype,
            docfilehash=dochash,
            content=strip_accents(doc.get_index_text()),
            label=strip_accents(doc.get_index_labels()),
            date=doc.date,
            last_read=last_mod
        )
        return True