Exemplo n.º 1
0
    def hello(self, author, encryptor):
        def callback(result):
            if result:
                self.gear.hosts.crypto_set(author, encryptor)
            else:
                print "Rejecting hello from sender: %r" % encryptor

        return self.validate(validation.make("hello", author, encryptor, callback))
Exemplo n.º 2
0
    def op(self, author, docname, op):
        def callback(result):
            if result:
                self.gear.storage.op(docname, op)
            else:
                print "Rejecting operation for docname: %r" % docname

        return self.validate(validation.make("operation", author, docname, op, callback))
Exemplo n.º 3
0
	def hello(self, author, encryptor):
		def callback(result):
			if result:
				self.gear.hosts.crypto_set(author, encryptor)
			else:
				print("Rejecting hello from sender: %r" % encryptor)
		return self.validate(
			validation.make("hello", author, encryptor, callback)
		)
Exemplo n.º 4
0
	def op(self, author, docname, op):
		def callback(result):
			if result:
				self.gear.storage.op(docname, op)
			else:
				print("Rejecting operation for docname: %r" % docname)
		return self.validate(
			validation.make("operation", author, docname, op, callback)
		)