Ejemplo n.º 1
0
def _reformat_ISBNs(text, strict=True):
    """Helper function to normalise ISBNs in text.

    @raises Exception: Invalid ISBN encountered when strict enabled
    """
    return textlib.reformat_ISBNs(
        text, lambda match: _format_isbn_match(match, strict=strict))
def _reformat_ISBNs(text, strict=True):
    """Helper function to normalise ISBNs in text.

    @raises Exception: Invalid ISBN encountered when strict enabled
    """
    return textlib.reformat_ISBNs(
        text, lambda match: _format_isbn_match(match, strict=strict))
Ejemplo n.º 3
0
def _reformat_ISBNs(text, strict=True):
    """Helper function to normalise ISBNs in text.

    @raises Exception: Invalid ISBN encountered when strict enabled
    """
    if not stdnum_isbn:
        if not scripts_isbn:
            raise NotImplementedError(
                'ISBN functionality not available.  Install stdnum package.')

        warn('package stdnum.isbn not found; using scripts.isbn',
             ImportWarning)

    return textlib.reformat_ISBNs(
        text, lambda match: _format_isbn_match(match, strict=strict))
Ejemplo n.º 4
0
def _reformat_ISBNs(text, strict=True):
    """Helper function to normalise ISBNs in text.

    @raises Exception: Invalid ISBN encountered when strict enabled
    """
    if not stdnum_isbn:
        if not scripts_isbn:
            raise NotImplementedError(
                'ISBN functionality not available.  Install stdnum package.')

        warn('package stdnum.isbn not found; using scripts.isbn',
             ImportWarning)

    return textlib.reformat_ISBNs(
        text, lambda match: _format_isbn_match(match, strict=strict))