Commits

WAKAYAMA shirou committed 365d41d

add list index API.

  • Participants
  • Parent commits ef0d300

Comments (0)

Files changed (2)

src/dipus/docstore.py

 
     return ret
 
+
+def listindex(indexroot):
+    ''' return index list '''
+    return os.listdir(indexroot)
+
 #
 # Creating Task Queue due to commit is too slow
 #

src/dipus/websetup.py

     return "index"
 
 
+@app.route('/_list/')
+def listindex():
+    ''' return index list '''
+    password = request.forms.get('password')
+    if auth(password) is False:
+        abort("Forbidden")
+
+    ret = {
+        "list": docstore.listindex(conf.indexroot)
+        }
+
+    return simplejson.dumps(ret)
+
+
+
 @app.route('/<_index>', method='POST')
 def updateDocument(_index):
     password = request.forms.get('password')