kopia lustrzana https://github.com/simonw/datasette
debugger: load 'ipdb' if present
* debugger: load 'ipdb' if present Transparently chooses between the IPython-enhanced 'ipdb' or the standard 'pdb'. * datasette install ipdb --------- Co-authored-by: Simon Willison <swillison@gmail.com>pull/2409/head
rodzic
4efcc29d02
commit
1f3fb5f96b
|
|
@ -5,9 +5,13 @@ from .utils.asgi import (
|
||||||
)
|
)
|
||||||
from .views.base import DatasetteError
|
from .views.base import DatasetteError
|
||||||
from markupsafe import Markup
|
from markupsafe import Markup
|
||||||
import pdb
|
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
try:
|
||||||
|
import ipdb as pdb
|
||||||
|
except ImportError:
|
||||||
|
import pdb
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import rich
|
import rich
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
||||||
|
|
@ -111,10 +111,14 @@ Debugging
|
||||||
|
|
||||||
Any errors that occur while Datasette is running while display a stack trace on the console.
|
Any errors that occur while Datasette is running while display a stack trace on the console.
|
||||||
|
|
||||||
You can tell Datasette to open an interactive ``pdb`` debugger session if an error occurs using the ``--pdb`` option::
|
You can tell Datasette to open an interactive ``pdb`` (or ``ipdb``, if present) debugger session if an error occurs using the ``--pdb`` option::
|
||||||
|
|
||||||
datasette --pdb fixtures.db
|
datasette --pdb fixtures.db
|
||||||
|
|
||||||
|
For `ipdb <https://pypi.org/project/ipdb/>`__, first run this::
|
||||||
|
|
||||||
|
datasette install ipdb
|
||||||
|
|
||||||
.. _contributing_formatting:
|
.. _contributing_formatting:
|
||||||
|
|
||||||
Code formatting
|
Code formatting
|
||||||
|
|
@ -349,4 +353,4 @@ Datasette bundles `CodeMirror <https://codemirror.net/>`__ for the SQL editing i
|
||||||
-p @rollup/plugin-node-resolve \
|
-p @rollup/plugin-node-resolve \
|
||||||
-p @rollup/plugin-terser
|
-p @rollup/plugin-terser
|
||||||
|
|
||||||
* Update the version reference in the ``codemirror.html`` template.
|
* Update the version reference in the ``codemirror.html`` template.
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue