simonw / datasette
Showing 2 of 3 files from the diff.

@@ -81,6 +81,11 @@
Loading
81 81
from .plugins import pm, DEFAULT_PLUGINS, get_plugins
82 82
from .version import __version__
83 83
84 +
try:
85 +
    import rich
86 +
except ImportError:
87 +
    rich = None
88 +
84 89
app_root = Path(__file__).parent.parent
85 90
86 91
# https://github.com/simonw/datasette/issues/283#issuecomment-781591015
@@ -1270,6 +1275,9 @@
Loading
1270 1275
1271 1276
            pdb.post_mortem(exception.__traceback__)
1272 1277
1278 +
        if rich is not None:
1279 +
            rich.console.Console().print_exception(show_locals=True)
1280 +
1273 1281
        title = None
1274 1282
        if isinstance(exception, Forbidden):
1275 1283
            status = 403

@@ -31,6 +31,14 @@
Loading
31 31
from .utils.testing import TestClient
32 32
from .version import __version__
33 33
34 +
# Use Rich for tracebacks if it is installed
35 +
try:
36 +
    from rich.traceback import install
37 +
38 +
    install(show_locals=True)
39 +
except ImportError:
40 +
    pass
41 +
34 42
35 43
class Config(click.ParamType):
36 44
    # This will be removed in Datasette 1.0 in favour of class Setting
Files Coverage
datasette 91.65%
Project Totals (34 files) 91.65%
1
coverage:
2
  status:
3
    project:
4
      default:
5
        informational: true
6
    patch:
7
      default:
8
        informational: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading