diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-01-04 12:16:09 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-01-04 12:16:09 +0000 |
| commit | 77e27e7de73333b8610c5e8967a3681636f844b0 (patch) | |
| tree | 68c2b34d3c63564d8b384bf21f1bf145029a9fb5 /django/utils | |
| parent | e07560a88e2bc1f5be2aabec25eca950259f7266 (diff) | |
Fixed #7679 -- Added (configurable) highlighting colors to the development server. Thanks to Rob Hudson, hunteke, and Bastian Kleineidam for the various patches that contributed to the final result.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12085 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/termcolors.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/django/utils/termcolors.py b/django/utils/termcolors.py index 009b69ed03..4bcf634061 100644 --- a/django/utils/termcolors.py +++ b/django/utils/termcolors.py @@ -78,6 +78,12 @@ PALETTES = { 'SQL_COLTYPE': {}, 'SQL_KEYWORD': {}, 'SQL_TABLE': {}, + 'HTTP_INFO': {}, + 'HTTP_SUCCESS': {}, + 'HTTP_REDIRECT': {}, + 'HTTP_BAD_REQUEST': {}, + 'HTTP_NOT_FOUND': {}, + 'HTTP_SERVER_ERROR': {}, }, DARK_PALETTE: { 'ERROR': { 'fg': 'red', 'opts': ('bold',) }, @@ -86,6 +92,12 @@ PALETTES = { 'SQL_COLTYPE': { 'fg': 'green' }, 'SQL_KEYWORD': { 'fg': 'yellow' }, 'SQL_TABLE': { 'opts': ('bold',) }, + 'HTTP_INFO': { 'opts': ('bold',) }, + 'HTTP_SUCCESS': { }, + 'HTTP_REDIRECT': { 'fg': 'green' }, + 'HTTP_BAD_REQUEST': { 'fg': 'red', 'opts': ('bold',) }, + 'HTTP_NOT_FOUND': { 'fg': 'yellow' }, + 'HTTP_SERVER_ERROR': { 'fg': 'magenta', 'opts': ('bold',) }, }, LIGHT_PALETTE: { 'ERROR': { 'fg': 'red', 'opts': ('bold',) }, @@ -94,6 +106,12 @@ PALETTES = { 'SQL_COLTYPE': { 'fg': 'green' }, 'SQL_KEYWORD': { 'fg': 'blue' }, 'SQL_TABLE': { 'opts': ('bold',) }, + 'HTTP_INFO': { 'opts': ('bold',) }, + 'HTTP_SUCCESS': { }, + 'HTTP_REDIRECT': { 'fg': 'green', 'opts': ('bold',) }, + 'HTTP_BAD_REQUEST': { 'fg': 'red', 'opts': ('bold',) }, + 'HTTP_NOT_FOUND': { 'fg': 'red' }, + 'HTTP_SERVER_ERROR': { 'fg': 'magenta', 'opts': ('bold',) }, } } DEFAULT_PALETTE = DARK_PALETTE @@ -117,7 +135,9 @@ def parse_color_setting(config_string): definition will augment the base palette definition. Valid roles: - 'error', 'notice', 'sql_field', 'sql_coltype', 'sql_keyword', 'sql_table' + 'error', 'notice', 'sql_field', 'sql_coltype', 'sql_keyword', 'sql_table', + 'http_info', 'http_success', 'http_redirect', 'http_bad_request', + 'http_not_found', 'http_server_error' Valid colors: 'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white' |
