climate-commits mailing list archives

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

URL: http://svn.apache.org/r1563528
Log:
CLIMATE-326 - Cleanup path leader retrieval endpoint

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=1563528&r1=1563527&r2=1563528&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:30 2014
@@ -128,14 +128,21 @@ def getResults(dirPath):
     else:
         return returnJSON
 
-@dir_app.route('/getPathLeader/')
-def getPathLeader():
-    returnJSON = {"leader": PATH_LEADER}
+@dir_app.route('/path_leader/')
+def get_path_leader():
+    ''' Return the path leader used for clean path creation.
+
+    * Example JSON Response *
+
+    .. sourcecode: javascript
+
+        {'leader': '/usr/local/rcmes'}
+    '''
+    return_json = {'leader': PATH_LEADER}
 
     if request.query.callback:
-        return "%s(%s)" % (request.query.callback, returnJSON)
-    else:
-        return returnJSON
+        return "%s(%s)" % (request.query.callback, return_json)
+    return return_json
 
 def _get_clean_directory_path(path_leader, dir_path):
     ''' Return a cleaned directory path with a defined path prefix.



Mime
View raw message