def get_num_style()

in src/simplify_docx/utils/paragrapy_style.py [0:0]


def get_num_style(p, doc):
    """
    The the paragraph's Numbering style
    """
    if getattr(p, "pPr", None) is not None \
            and p.pPr.numPr is not None\
            and p.pPr.numPr.numId is not None:
        # the numbering style doc
        np = doc.part.numbering_part
        # the map between numbering id and the numbering style
        num = np.element.find("w:num[@w:numId='%s']" % p.pPr.numPr.numId.val,
                               np.element.nsmap)
        _path = "w:abstractNum[@w:abstractNumId='%s']" % num.abstractNumId.val
        # the numbering styles themselves
        abstractNumbering = np.element.find(_path, np.element.nsmap)
        return abstractNumbering.find("w:lvl[@w:ilvl='%s']" % p.pPr.numPr.ilvl.val,
                                      np.element.nsmap)
    return None