Commit Graph

91 Commits

Author SHA1 Message Date
Matt Good 32e0aa8ca3 Ensure profiler "Calls" are sorted numerically
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
2015-04-15 12:39:59 -07:00
Matt Good e052b005ec Merge branch 'package-versions' 2015-04-14 19:21:45 -07:00
Matt Good 2f18ac90f9 Convert versions template to 2 spaces for indentation 2015-04-14 19:20:29 -07:00
Matt Good 612f93c129 Show relative paths for package paths
Since most of the paths are the same, only display the path relative to the
main Python library path.
2015-04-14 19:18:45 -07:00
Matt Good 7e2de8f588 Merge pull request #48 from yoloseem/sqlparse
Suggestion: Use sqlparse.format() for better sql indentation
2015-04-14 15:44:00 -07:00
Matt Good 5aaa7a6634 Merge branch 'routes' 2015-04-14 15:28:16 -07:00
Matt Good f7feecc751 Include the "static" route in the list
While this is enabled for most apps, it's optional and might still be useful to display.
2015-04-14 15:23:04 -07:00
Matt Good cfe1624730 Simplify route methods display
Show just the names as text, without the Python list syntax formatting.
2015-04-14 14:58:31 -07:00
Matt Good 95d7eb977f Format route_list template with spaces 2015-04-14 14:57:47 -07:00
Eric Workman 5a05620257 Add tablesorter to slqlalchemy panel 2015-04-10 15:44:38 -04:00
Matt Good 10c03880c7 Safely decode non-ascii SQL queries for display
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
2014-12-04 14:06:48 -08:00
Matt Good 3fcdfc8f83 Use platform-sensitive filename normalization
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
2014-12-02 18:15:59 -08:00
Matt Good 914553ddf5 Consolidate redundant code for SQL select/explain
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.
2014-11-24 15:04:50 -08:00
Matt Good b4fe0b954c Fix misspelled CSS classes 2014-11-24 14:46:41 -08:00
Matt Good 7557ee6794 Ensure SQL queries are HTML-escaped
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
2014-11-24 14:36:56 -08:00
Matt Good 382c5e7da9 Remove old commented code
Looks like some old code from the original Django toolbar was left in the
template.
2014-11-24 14:25:32 -08:00
= 81f8e34846 Removed printing of routes to console. 2014-03-23 15:14:28 +11:00
= 79717926a5 Added endpoints, HTTP methods, Is alias and Redirect to columns to route list. 2014-03-23 15:12:31 +11:00
Justin McKay 5084428c9d Added the Route List panel to show the routes that are available within Flask. 2014-03-22 23:57:48 +11:00
Matt Good 82295aa4aa printable filter should replace non-ascii bytes
In Python 2, when repr() returns bytes, replace any non-ascii bytes
with the unicode ? character to ensure that the result is printable.

Fixes #66
2014-02-02 14:46:41 -08:00
Matt Good 70488fc14a Fix Py3 support for bytes SQL queries
Fixes #64
2014-01-14 17:56:47 -08:00
Ivan Ivaschenko 903ed85f00 remove coding:utf-8 and add some style fixes 2013-11-29 00:17:15 +02:00
Ivan Ivaschenko 5710314252 pep8 formatting + coding: utf8 2013-11-28 18:31:29 +02:00
Matt Good bd37db9dc4 Fix SQLAlchemy URL registration
The init_app() restructuring in 356e6c removed "load_panels()", but need
to add it back so panels like SQLAlchemy can register their URLs on the
Blueprint before it's activated.
2013-11-06 09:33:00 -08:00
Matt Good 091c4fa70c Compatibility fixes for Python 3
Fixes #54 (at least the basic stuff, this is still a bit experimental)
2013-11-06 09:06:05 -08:00
Matt Good 6d8249160d Rename "settings" panel to "config" 2013-11-01 14:04:10 -07:00
Matt Good 1e046d57f4 Remove some unneeded code from SettingsVars panel 2013-11-01 12:42:38 -07:00
Matt Good 9e3546b416 Merge commit 'refs/pull/51/head' of github.com:mgood/flask-debugtoolbar
Conflicts:
	flask_debugtoolbar/toolbar.py
2013-11-01 11:41:08 -07:00
Matt Good 26034475f2 Load panels with werkzeug's "import_string"
Also add back caching of the loaded panel classes.
This prevents repeated warnings if there was an import error loading the
class the first time.
2013-07-30 17:56:54 -07:00
Matt Good 356e6c8268 Restructure to support init_app
Fixes #38
2013-07-30 17:37:34 -07:00
Matt Good 5870fce178 Can check blueprint name instead of URL prefix 2013-07-30 09:25:02 -07:00
Alexey Diyan 855c7ab377 Port SettingsVarsDebugPanel from Django DebugToolbar 2013-05-10 19:17:32 +03:00
Lucas Taylor ccd8ba66b2 Display installed packages and versions in Versions panel (requires setup tools) 2013-03-27 17:28:51 -07:00
Lucas Taylor 093763909f Display installed packages and versions in Versions panel (requires Yolk) 2013-03-27 17:16:28 -07:00
Matt Good 115e874a39 Reformat templates and static files with 2 space indentation
Fixes #45
2013-03-16 16:21:39 -07:00
Hyunjun Kim bd2b65d068 Improve format_sql(): use sqlparse.format() 2013-03-11 13:33:41 +09:00
Matt Good b7c39113e7 Template editor should use Jinja loader's encoding
The template loader wouldn't handle non-ASCII template encodings.
Updated it to use the encoding parameter of the Jinja loader when
reading and writing the template files.

Fixes #46
2013-03-08 09:00:10 -08:00
Matt Good 3bea63dc8a Fix werkzeug request logging with the log panel
Werkzeug will disable its default logging setup if another log handler
is already configured.  At some point the initialization order changed
and the logging panel's handler is getting added first now, so
werkzeug's request log will not be printed to the console by default. By
explicitly calling werkzeug's logger we now make sure it's initialized
before the logging panel's handler.

Fixes #33
2013-02-21 10:53:16 -08:00
Matt Good 856eb52a95 Nice error message for un-repr-able objects
The "printable" filter can throw an exception when trying to display a
user object whose __repr__ implementation returns unicode, which repr()
does not allow. Catch it and display a more informative message
instead.

See #31 and #39
2013-02-20 20:46:31 -08:00
Matt Good 50017f13a7 Switch to itsdangerous for SQL query signing
Fixing #31 where the query signing would break when the SECRET_KEY
contained non-ascii values. In the process switch to itsdangerous
instead of rolling our own signatures.
2013-02-20 20:02:00 -08:00
Matt Good 561889738f Merge pull request #41 from crosspop/ajaxfix
Intercept redirect only if it’s not XHR (Ajax)
2013-02-19 17:01:11 -08:00
Nicholas Bollweg 0f923475c8 adding reference to noConflict'ed jQuery 2013-02-13 12:29:45 -05:00
Hong Minhee 43df69ab24 Intercept redirect only if it's not XHR (Ajax)
Intercept redirect can't really help debugging at all
if requests are XHR (Ajax), because browsers just don't render
their response by default.
2013-01-17 05:11:26 +09:00
Matt Good 3e4cd1ecfa Merge pull request #35 from rconradharris/patch-1
Profiler: Use update_wrapper on partial

If the profiler panel is applied before the request-vars panel, the wrapper added by the profiler causes an error since it's missing a `__module__` attribute.
2012-09-25 10:43:19 -07:00
Matt Good cfa5984d3e Convert SQLAlchemy query duration to ms to match the label
The SQLAlchemy panel labels the query duration column "(ms)" but the
times from Flask-SQLAlchemy are given in seconds.

Fixes #36
2012-09-25 09:45:52 -07:00
Rick Harris c9c0228a62 Profiler: Use update_wrapper on partial
The `update_wrapper` call is needed so that the new partial
func inherits the `__module__` of the original function.

The `__module__` is needed because the request-vars panel uses
`func.__module__` in building the qualified name.
2012-09-04 19:45:51 -05:00
Matt Good 80eb747816 Release 0.7.1 to fix the in-place loading of the template editor 2012-05-18 18:20:28 -07:00
Matt Good c7b0b4bf2b Merge remote-tracking branch 'evoloshchuk/enable_profiler_panel' into enable_profiler_panel 2012-05-18 17:18:25 -07:00
Matt Good 18414d733b Add a live template editor to the template panel 2012-05-18 16:32:03 -07:00
Matt Good 97fc95f769 Merge branch 'profile-sorter' 2012-04-17 08:33:26 -07:00