Пример #1
0
 def _check_subscriber(self, request, subid):
     """Check that there was an API key, and republish"""
     if len(subid) == 1:
         # send the object to the republisher
         public = subid[0][1]
         subid = subid[0][0]
         obj = transfer.read(request)
         self.republisher.republish(request.prepath[-1], public, obj)
         util.push_metadata(obj)
         return subid, obj
     else:
         raise SmapException("Invalid key\n", 404)
Пример #2
0
 def _check_subscriber(self, request, subid):
     """Check that there was an API key, and republish"""
     if len(subid) == 1:
         # send the object to the republisher
         public = subid[0][1]
         subid = subid[0][0]
         obj = transfer.read(request)
         self.republisher(request.prepath[-1], public, obj)
         util.push_metadata(obj)
         return subid, obj
     else:
         raise SmapException("Invalid key\n", 404)
Пример #3
0
    def _check_subscriber(self, request, subid):
        """Check that there was an API key, and republish"""
        if len(subid) == 1:
            # send the object to the republisher
            public = subid[0][1]
            subid = subid[0][0]
            obj = transfer.read(request)

            # we want to republish the non-munged version of the data,
            # but then if that fails it may kill further processing.
            d = self.republisher(request.prepath[-1], public, obj)
            util.push_metadata(obj)
            d.addCallback(lambda _: (subid, obj))

            return d
        else:
            raise SmapException("Invalid key\n", 404)
Пример #4
0
    def _check_subscriber(self, request, subid):
        """Check that there was an API key, and republish"""
        if len(subid) == 1:
            # send the object to the republisher
            public = subid[0][1]
            subid = subid[0][0]
            obj = transfer.read(request)

            # we want to republish the non-munged version of the data,
            # but then if that fails it may kill further processing.
            d = self.republisher(request.prepath[-1], public, obj)
            util.push_metadata(obj)
            d.addCallback(lambda _: (subid, obj))

            return d
        else:
            raise SmapException("Invalid key\n", 404)