Esempio n. 1
0
    def async_GET(self, request):
        b = Backend()
        result = yield b.get([self.path], self.method)
        if self.method == 'descendant':
            retval = RESTResult(code=200, content=result)
        else:
            retval = RESTResult(code=200, content=result[0][1])

        defer.returnValue(retval)
Esempio n. 2
0
 def jsonrpc_get(self):
     try:
         b = Backend()
         resp = yield b.get([self.path], None)
         if resp:
             defer.returnValue(resp[0][1])
         else:
             defer.returnValue(dict())
     except:
         raise
Esempio n. 3
0
 def jsonrpc_get(self, paths, method='self'):
     b = Backend()
     return b.get(paths, method)