This reverts commit 45b70c952f.
This commit broke the readthedocs build because RTD is building the docs
without running setup.py. So there is no package metadata.
In the SQLAlchemy panel, detect if Flask-SQLAlchemy is not set up to record
queries for the current app, and display the necessary steps to set it up.
The following steps will be detected and displayed if needed:
* install Flask-SQLAlchemy package
* add the extension to this app
* set SQLALCHEMY_RECORD_QUERIES if DEBUG is False
It doesn't seem to be necessary to remove the "even / odd" styles before
sorting, since they are explicitly toggled to the right state after sorting. It
should be slightly more responsive to skip this step when sorting large tables.
JS Tablesorter's detection of the data type is occasionally confused when the
profiler calls show ratios like "94/57" for total calls to primitive calls.
This change enables parsing "data" attributes on the table headers to pass as
options to Tablesorter. This way we can explicitly specify to use the "digit"
sorter which works the way we want.
Fixes#62
SQL queries containing non-ascii byte strings would cause errors, both with and
without Pygments highlighting.
This updates the non-Pygments case to handle a simple decoding to ensure the
value is ascii-safe. It also removes passing an explicit "utf-8" encoding to
Pygments, since this causes errors when the bytes are not utf-8. When the
encoding is omitted, Pygments will default to "guess" the encoding by trying
utf-8 and falling back to latin-1.
Fixes#55
The os.path.commonprefix() function only does basic string prefix checking, and
isn't aware of case-insensitive file names, or path separators. Instead, this
switches the filename formatting to use os.path.relpath() for normalizing paths
relative to sys.path.
Fixes#67
The code for displaying the SQL select results and explain plan were nearly
identical, so this consolidates it to one function and template. It also fixes
correctly displaying the timing results as milliseconds.
The SQL queries were displayed with the `safe` filter which allowed properly
including the Pygments-highlighted HTML, but if Pygments wasn't installed this
allowed the raw SQL to be included without escaping. This change removes the
`safe` filter and instead wraps the Pygments HTML with the `Markup` class. This
allows proper auto-escaping in the template.
Fixes#70