~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/__init__.py

  • Committer: Matt Nordhoff
  • Date: 2009-05-04 20:29:13 UTC
  • Revision ID: mnordhoff@mattnordhoff.com-20090504202913-tmlkyrrlwojyzgha
Fix typo in NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# along with this program; if not, write to the Free Software
18
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
19
 
20
 
import bzrlib.errors
21
20
import time
22
21
 
23
 
from paste.httpexceptions import HTTPNotFound
24
22
from paste.request import path_info_pop, parse_querystring
25
23
 
26
24
from loggerhead import util
72
70
        kwargs = dict(parse_querystring(environ))
73
71
        util.set_context(kwargs)
74
72
        args = []
75
 
        while True:
 
73
        while 1:
76
74
            arg = path_info_pop(environ)
77
75
            if arg is None:
78
76
                break
99
97
        if 'Content-Type' not in headers:
100
98
            headers['Content-Type'] = 'text/html'
101
99
        writer = start_response("200 OK", headers.items())
102
 
        if environ.get('REQUEST_METHOD') == 'HEAD':
103
 
            # No content for a HEAD request
104
 
            return []
105
100
        template = load_template(self.template_path)
106
101
        z = time.time()
107
102
        w = BufferingWriter(writer, 8192)
117
112
        if h is None:
118
113
            return None
119
114
        if len(self.args) > 0 and self.args != ['']:
120
 
            try:
121
 
                revid = h.fix_revid(self.args[0])
122
 
            except bzrlib.errors.NoSuchRevision:
123
 
                raise HTTPNotFound;
 
115
            return h.fix_revid(self.args[0])
124
116
        else:
125
 
            revid = h.last_revid
126
 
        return revid
 
117
            return h.last_revid