~mordred/swift/sphinx-update-sphinx-config

« back to all changes in this revision

Viewing changes to swift/account/server.py

  • Committer: Tarmac
  • Author(s): Monty Taylor
  • Date: 2010-07-26 15:27:29 UTC
  • mfrom: (40.1.1 fix-pep8)
  • Revision ID: hudson@openstack.org-20100726152729-4dz6gc11ky2qvffi
Fixed PEP8 warnings

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
        # refactor out the container existence check here and retest
122
122
        # everything.
123
123
        try:
124
 
            drive, part, account, container = split_path(unquote(req.path), 3, 4)
 
124
            drive, part, account, container = split_path(unquote(req.path),
 
125
                                                         3, 4)
125
126
        except ValueError, err:
126
127
            return HTTPBadRequest(body=str(err), content_type='text/plain',
127
128
                                                    request=req)
139
140
            'X-Account-Object-Count': info['object_count'],
140
141
            'X-Account-Bytes-Used': info['bytes_used'],
141
142
            'X-Timestamp': info['created_at'],
142
 
            'X-PUT-Timestamp': info['put_timestamp'],
143
 
        }
 
143
            'X-PUT-Timestamp': info['put_timestamp']}
144
144
        if container:
145
145
            container_ts = broker.get_container_timestamp(container)
146
146
            if container_ts is not None:
167
167
            'X-Account-Object-Count': info['object_count'],
168
168
            'X-Account-Bytes-Used': info['bytes_used'],
169
169
            'X-Timestamp': info['created_at'],
170
 
            'X-PUT-Timestamp': info['put_timestamp']
171
 
        }
 
170
            'X-PUT-Timestamp': info['put_timestamp']}
172
171
        try:
173
172
            prefix = get_param(req, 'prefix')
174
173
            delimiter = get_param(req, 'delimiter')
203
202
            for (name, object_count, bytes_used, is_subdir) in account_list:
204
203
                name = simplejson.dumps(name)
205
204
                if is_subdir:
206
 
                    json_out.append('{"subdir":%s}'% name)
 
205
                    json_out.append('{"subdir":%s}' % name)
207
206
                else:
208
207
                    json_out.append(json_pattern %
209
208
                        (name, object_count, bytes_used))
211
210
        elif format == 'xml':
212
211
            out_content_type = 'application/xml'
213
212
            output_list = ['<?xml version="1.0" encoding="UTF-8"?>',
214
 
                           '<account name="%s">'%account]
 
213
                           '<account name="%s">' % account]
215
214
            for (name, object_count, bytes_used, is_subdir) in account_list:
216
215
                name = saxutils.escape(name)
217
216
                if is_subdir:
292
291
        else:
293
292
            self.logger.info(log_message)
294
293
        return res(env, start_response)
295