Beispiel #1
0
 def got_post(postdoc, error):
     if error:
         self.result(xmlrpclib.Fault(500, str(error)))
     elif not postdoc:
         self.result(xmlrpclib.Fault(404, "Not found"))
     else:
         post = Post(**postdoc)
         self.result(post.to_metaweblog(self.application))
Beispiel #2
0
 def got_post(postdoc, error):
     if error:
         raise error
     if not postdoc:
         self.result(xmlrpclib.Fault(404, "Not found"))
     else:
         post = Post(**postdoc)
         self.result(post.to_metaweblog(self.application))
Beispiel #3
0
    def _get_post(self, postid):
        postdoc = yield self.settings['db'].posts.find_one(ObjectId(postid))

        if not postdoc:
            self.result(xmlrpclib.Fault(404, "Not found"))
        else:
            post = Post(**postdoc)
            self.result(post.to_metaweblog(self.application))
Beispiel #4
0
    def _get_post(self, postid):
        postdoc = yield self.settings['db'].posts.find_one(ObjectId(postid))

        if not postdoc:
            self.result(xmlrpclib.Fault(404, "Not found"))
        else:
            post = Post(**postdoc)
            self.result(post.to_metaweblog(self.application))