bbangert / dozer


WSGI middleware fork of Robert Brewer's Dowser
Clone URL : http://bitbucket.org/bbangert/dozer/ (size: 146.1 KB)
commit 28: c971fa11b168
parent 27: d028d3b71bd9
branch: trunk
Fixed references in profile.css so that it doesn't trigger not existing urls that are then profiled.
Armin Ronacher / mitsuhiko
4 months ago

Changed (Δ110 bytes):

raw changeset »

dozer/media/profile.css (10 lines added, 10 lines removed)

dozer/profile.py (3 lines added, 5 lines removed)

Up to file-list dozer/media/profile.css:

@@ -17,15 +17,15 @@ table {border: 1px solid #cccdcd; border
17
17
/* @end */
18
18
19
19
/* @group Defaults */
20
body {background: #0d0d0d url(/images/body.gif) 0 0 repeat-x; color: #fff; font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, Arial, sans-serif; font-size: 12px; text-align: center;}
20
body {background: #0d0d0d url(images/body.gif) 0 0 repeat-x; color: #fff; font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, Arial, sans-serif; font-size: 12px; text-align: center;}
21
21
h1, h2, h3, h4, h5, h6, p, img, ul, ol, li, dl, dt, dd, blockquote, pre, code, div, table, tr, th, td, tbody, tfoot, fieldset, legend, input, textarea, select, button {line-height: 18px;}
22
22
23
23
h1, h2, h3, h4, h5, h6, dt, legend {background: transparent; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;}
24
24
h1 {color: #fff; font-size: 18px;}
25
h2 {background: #939393 url(/images/controller.gif) 0 -9px repeat-x; border-bottom: 1px solid #666; clear: both; color: #333; font-weight: normal; padding: 3px 18px;}
25
h2 {background: #939393 url(images/controller.gif) 0 -9px repeat-x; border-bottom: 1px solid #666; clear: both; color: #333; font-weight: normal; padding: 3px 18px;}
26
26
h2 span {font-weight: bold;}
27
27
h3 {}
28
h4 {background: #e6e6e6 url(/images/section.gif) 0 100% repeat-x; color: #666; font-size: 12px; letter-spacing: 1px; padding: 3px 18px;}
28
h4 {background: #e6e6e6 url(images/section.gif) 0 100% repeat-x; color: #666; font-size: 12px; letter-spacing: 1px; padding: 3px 18px;}
29
29
h4 img {padding-left: 10px; margin-bottom: -4px; padding-top: 0px;}
30
30
h4 span {font-weight: normal; text-transform: uppercase; font-size: 11px;}
31
31
h5 {font-size: 14px;}
@@ -46,8 +46,8 @@ a:active {color: #343434; text-decoratio
46
46
a:active {color: #343434; text-decoration: none;}
47
47
48
48
table {empty-cells: show; margin-bottom: 18px;}
49
th {background: #eee url(/images/th.gif) 0 100% repeat-x;}
50
td {background: transparent url(/images/rows.gif) 0 100% no-repeat;}
49
th {background: #eee url(images/th.gif) 0 100% repeat-x;}
50
td {background: transparent url(images/rows.gif) 0 100% no-repeat;}
51
51
th, td {padding: 3px 9px; vertical-align: middle;}
52
52
img {background: transparent; border: 0;}
53
53
legend {}
@@ -79,7 +79,7 @@ version: 2.5.1
79
79
80
80
.profile_bar { margin: 0 4px; margin-left: 10px; list-style: none; }
81
81
.profile_bar li { height: 20px; color: #fff; vertical-align: middle; font-size: 11px; padding: 0 4px;
82
 background-image: url(/_profiler/media/images/fade.png);
82
 background-image: url(images/fade.png);
83
83
 background-position: bottom left;
84
84
 background-repeat: repeat-x;
85
85
}
@@ -101,9 +101,9 @@ version: 2.5.1
101
101
102
102
#profile .profile_bar li { text-align: center; }
103
103
104
#profile li.step { float: left; padding-left: 4px; background: url(/_profiler/media/images/pip.gif) 4px 0 no-repeat; clear: left; }
105
#profile li.with-children { background: url(/_profiler/media/images/arrows.gif) 4px 0 no-repeat;}
106
#profile li.opened { background: url(/_profiler/media/images/arrows.gif) 4px -20px no-repeat; }
104
#profile li.step { float: left; padding-left: 4px; background: url(images/pip.gif) 4px 0 no-repeat; clear: left; }
105
#profile li.with-children { background: url(images/arrows.gif) 4px 0 no-repeat;}
106
#profile li.opened { background: url(images/arrows.gif) 4px -20px no-repeat; }
107
107
108
108
#profile ul { margin: 0; padding: 0; }
109
109
#profile ul span.time { margin-right: 12px; }
@@ -144,7 +144,7 @@ version: 2.5.1
144
144
#profile-flash p { padding: 0; padding-left: 20px; font-family: sans-serif; background: none; color: #000; border: 0; }
145
145
#profile-flash.tuneup-show { display: block; }
146
146
#profile-flash.tuneup-error { background: #FDFCDB; }
147
#profile-flash.tuneup-error p { background: url(/images/warning.gif) 0 50% no-repeat; }
147
#profile-flash.tuneup-error p { background: url(images/warning.gif) 0 50% no-repeat; }
148
148
#profile-flash.tuneup-notice { padding-left: 0; background: #E4FFDE; }
149
149
150
150
#profile .profile_bar { float: left; width: 400px; padding: 0;}

Up to file-list dozer/profile.py:

@@ -27,7 +27,7 @@ class Profiler(object):
27
27
        self.ignored_paths = map(re.compile, ignored_paths)
28
28
        tmpl_dir = os.path.join(here_dir, 'templates')
29
29
        self.mako = TemplateLookup(directories=[tmpl_dir])
30
    
30
31
31
    def __call__(self, environ, start_response):
32
32
        assert not environ['wsgi.multiprocess'], (
33
33
            "Dozer middleware is not usable in a "
@@ -38,10 +38,8 @@ class Profiler(object):
38
38
            return self.profiler(req)(environ, start_response)
39
39
        for regex in self.ignored_paths:
40
40
            if regex.match(environ['PATH_INFO']) is not None:
41
                break
42
        else:
43
            return self.run_profile(environ, start_response)
44
        return self.app(environ, start_response)
41
                return self.app(environ, start_response)
42
        return self.run_profile(environ, start_response)
45
43
46
44
    def profiler(self, req):
47
45
        assert req.path_info_pop() == '_profiler'