Esempio n. 1
0
target = os.path.normpath(
    os.path.join(docs_root_dir, f"docs/source/tracebacks_{LANG}.rst"))

intro_text = """
|france| Friendly tracebacks - en Français
===========================================

Le but principal de friendly est de fournir des rétroactions plus
conviviales que les fameux **tracebacks** de Python lorsqu'une exception survient.

.. note::

     Le contenu de cette page a été généré par l'exécution de
     {name} situé dans le répertoire ``tests/``.
     Ceci a besoin d'être fait de manière explicite lorsqu'on veut
     faire des corrections ou des ajouts, avant de faire la mise
     à jour du reste de la documentation avec Sphinx.

Friendly version: {friendly}
Python version: {python}

""".format(
    friendly=friendly.__version__,
    python=platform.python_version(),
    name=__file__,
)

print(f"Python version: {platform.python_version()}; French")

trb_common.create_tracebacks(target, intro_text)
Esempio n. 2
0
intro_text = """
Friendly tracebacks - in English
======================================

Friendly aims to provide friendlier feedback when an exception
is raised than what is done by Python.
Below, we can find some examples. SyntaxError cases, as well as TabError and
IndentationError cases, are shown in a separate page.
Not all cases handled by friendly are included here.

.. note::

     The content of this page is generated by running
     {name} located in the ``tests/`` directory.
     This needs to be done explicitly, independently of updating the
     documentation using Sphinx.

Friendly version: {friendly}
Python version: {python}

""".format(
    friendly=friendly.__version__,
    python=platform.python_version(),
    name=__file__,
)

print(f"Python version: {platform.python_version()}; English")

trb_common.create_tracebacks(target, intro_text, messages=messages)
import trb_common

target = os.path.normpath(
    os.path.join(docs_root_dir, "docs/source/tracebacks_markdown.md"))

intro_text = """
# Friendly tracebacks - markdown_docs format

<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The content of this page is generated by running
{name} located in the <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory.
This needs to be done explicitly, independently of updating the
documentation using Sphinx.
</p>
</div>

Friendly version: {friendly}
Python version: {python}

""".format(
    friendly=friendly.version.doc_version(),
    python=platform.python_version(),
    name=__file__,
)

print(f"Python version: {platform.python_version()}; --- markdown format")

trb_common.create_tracebacks(target, intro_text, formatter="markdown_docs")