Changeset - 8dae2a288339
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 12 years ago 2013-05-22 23:36:59
marcin@python-works.com
API cli should prefer to display errors instead of responses
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/bin/rhodecode_api.py
Show inline comments
 
@@ -105,7 +105,11 @@ def main(argv=None):
 
    if args.format == FORMAT_PRETTY:
 
        print 'Calling method %s => %s' % (method, apihost)
 

	
 
    json_data = api_call(apikey, apihost, method, **margs)['result']
 
    json_resp = api_call(apikey, apihost, method, **margs)
 
    if json_resp['error']:
 
        json_data = json_resp['error']
 
    else:
 
        json_data = json_resp['result']
 
    if args.format == FORMAT_JSON:
 
        print json.dumps(json_data)
 
    elif args.format == FORMAT_PRETTY:
0 comments (0 inline, 0 general)