climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1563523 - /incubator/climate/trunk/ocw-ui/backend/directory_helpers.py
Date Sat, 01 Feb 2014 23:57:21 GMT
Author: joyce
Date: Sat Feb  1 23:57:21 2014
New Revision: 1563523

URL: http://svn.apache.org/r1563523
Log:
CLIMATE-326 - Fix dir listing return format

- Add default dir_path value for /dir/list so that '/' is handled
  properly. Otherwise it is truncated out and ignored.
- Return directory listing as a dict instead of just a list of strings.

Modified:
    incubator/climate/trunk/ocw-ui/backend/directory_helpers.py

Modified: incubator/climate/trunk/ocw-ui/backend/directory_helpers.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/directory_helpers.py?rev=1563523&r1=1563522&r2=1563523&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/directory_helpers.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/directory_helpers.py Sat Feb  1 23:57:21 2014
@@ -27,8 +27,9 @@ dir_app = Bottle()
 
 PATH_LEADER = "/usr/local/rcmes"
 
+@dir_app.route('/list/')
 @dir_app.route('/list/<dir_path:path>')
-def get_directory_info(dir_path):
+def get_directory_info(dir_path='/'):
     ''''''
     try:
         clean_path = _get_clean_directory_path(PATH_LEADER, dir_path)
@@ -52,8 +53,8 @@ def get_directory_info(dir_path):
         sorted(dir_info, key=lambda s: s.lower())
 
     if request.query.callback:
-        return "%s(%s)" % (request.query.callback, return_json)
-    return return_json
+        return "%s(%s)" % (request.query.callback, {'listing': dir_info})
+    return {'listing': dir_info}
 
 WORK_DIR = "/tmp/rcmet"
 



Mime
View raw message