~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/__init__.py

  • Committer: Matt Nordhoff
  • Date: 2009-10-21 12:12:42 UTC
  • mto: This revision was merged to the branch mainline in revision 392.
  • Revision ID: mnordhoff@mattnordhoff.com-20091021121242-kcgfn810xp0a1sbf
Remove empty docstring

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
94
92
 
95
93
        vals.update(self.get_values(path, kwargs, headers))
96
94
 
97
 
        self.log.info('Getting information for %s: %.3f secs' % (
 
95
        self.log.info('Getting information for %s: %r secs' % (
98
96
            self.__class__.__name__, time.time() - z))
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)
108
103
        template.expand_into(w, **vals)
109
104
        w.flush()
110
105
        self.log.info(
111
 
            'Rendering %s: %.3f secs, %s bytes' % (
 
106
            'Rendering %s: %r secs, %s bytes' % (
112
107
                self.__class__.__name__, time.time() - z, w.bytes))
113
108
        return []
114
109
 
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