comparison rhodecode/controllers/api/__init__.py @ 1818:cf51bbfb120e beta

auto white-space removal
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 29 Dec 2011 07:35:51 +0200
parents 6274adc06988
children 89efedac4e6c
comparison
equal deleted inserted replaced
1817:523b1011a625 1818:cf51bbfb120e
5 5
6 JSON RPC controller 6 JSON RPC controller
7 7
8 :created_on: Aug 20, 2011 8 :created_on: Aug 20, 2011
9 :author: marcink 9 :author: marcink
10 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> 10 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
11 :license: GPLv3, see COPYING for more details. 11 :license: GPLv3, see COPYING for more details.
12 """ 12 """
13 # This program is free software; you can redistribute it and/or 13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License 14 # modify it under the terms of the GNU General Public License
15 # as published by the Free Software Foundation; version 2 15 # as published by the Free Software Foundation; version 2
16 # of the License or (at your opinion) any later version of the license. 16 # of the License or (at your opinion) any later version of the license.
17 # 17 #
18 # This program is distributed in the hope that it will be useful, 18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details. 21 # GNU General Public License for more details.
22 # 22 #
23 # You should have received a copy of the GNU General Public License 23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software 24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26 # MA 02110-1301, USA. 26 # MA 02110-1301, USA.
27 27
224 self._error = str(json_exc) 224 self._error = str(json_exc)
225 225
226 if self._error is not None: 226 if self._error is not None:
227 raw_response = None 227 raw_response = None
228 228
229 response = dict(id=self._req_id, result=raw_response, 229 response = dict(id=self._req_id, result=raw_response,
230 error=self._error) 230 error=self._error)
231 231
232 try: 232 try:
233 return json.dumps(response) 233 return json.dumps(response)
234 except TypeError, e: 234 except TypeError, e:
257 257
258 if isinstance(func, types.MethodType): 258 if isinstance(func, types.MethodType):
259 return func 259 return func
260 else: 260 else:
261 raise AttributeError("No such method: %s" % self._req_method) 261 raise AttributeError("No such method: %s" % self._req_method)
262