mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
new-admin: Negligible syntax changes in django.views.debug in preparation for merge to trunk
git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@1373 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c18d99735e
commit
c8719b7765
@ -1,18 +1,14 @@
|
|||||||
import re
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import inspect
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from os.path import dirname, join as pathjoin
|
|
||||||
from django.core.template import Template, Context
|
from django.core.template import Template, Context
|
||||||
from django.utils.httpwrappers import HttpResponseServerError, HttpResponseNotFound
|
|
||||||
from itertools import count, izip
|
|
||||||
from django.utils.html import escape
|
from django.utils.html import escape
|
||||||
|
from django.utils.httpwrappers import HttpResponseServerError, HttpResponseNotFound
|
||||||
|
import inspect, os, re, sys
|
||||||
|
from itertools import count, izip
|
||||||
|
from os.path import dirname, join as pathjoin
|
||||||
|
|
||||||
HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD')
|
HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD')
|
||||||
|
|
||||||
def linebreak_iter(template_source):
|
def linebreak_iter(template_source):
|
||||||
import re
|
|
||||||
newline_re = re.compile("^", re.M)
|
newline_re = re.compile("^", re.M)
|
||||||
for match in newline_re.finditer(template_source):
|
for match in newline_re.finditer(template_source):
|
||||||
yield match.start()
|
yield match.start()
|
||||||
@ -33,10 +29,8 @@ def get_template_exception_info(exc_type,exc_value,tb):
|
|||||||
before = escape(template_source[upto:start])
|
before = escape(template_source[upto:start])
|
||||||
during = escape(template_source[start:end])
|
during = escape(template_source[start:end])
|
||||||
after = escape(template_source[end:next - 1])
|
after = escape(template_source[end:next - 1])
|
||||||
|
|
||||||
source_lines.append( (num, escape(template_source[upto:next - 1])) )
|
source_lines.append( (num, escape(template_source[upto:next - 1])) )
|
||||||
upto = next
|
upto = next
|
||||||
|
|
||||||
total = len(source_lines)
|
total = len(source_lines)
|
||||||
|
|
||||||
top = max(0, line - context_lines)
|
top = max(0, line - context_lines)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user