Beispiel #1
0
    def rpc_uncreateagent(self, agents):
        r = []
        for a in logic.parse_clause(agents):
            a = paths.to_relative(a, self.__name)
            if not self.__workspace.unload(a, True):
                r.append(errors.doesnt_exist('agent', 'un create'))

        return logic.render_term(r)
Beispiel #2
0
 def destroy(self):
     # remove this widget from the targets controllers
     address = self.get_property_string('target-id')
     myrid = paths.to_relative(self.id(), scope=paths.id2scope(address))
     cs = logic.render_term(
         logic.make_term('conn', None, None, myrid, None, 'ctl'))
     if address != '':
         rpc.invoke_rpc(address, 'disconnect', cs)
Beispiel #3
0
 def setup(self, address, name):
     myrid = paths.to_relative(self.id(), scope=paths.id2scope(address))
     self.set_property_long('ref-count', 1)
     self.set_property_string('target-name', name)
     self.set_property_string('target-id', address)
     cs = logic.render_term(
         logic.make_term('conn', None, None, myrid, None, 'ctl'))
     if address != '':
         return rpc.invoke_rpc(address, 'connect', cs)
     else:
         return False
Beispiel #4
0
    def rpc_delinstance(self, arg):
        iid = paths.to_relative(paths.to_absolute(arg, scope=self.scope()))
        pid = None
        for v in self.values():
            if iid == v.id():
                pid = v.input().id()
                break

        if pid:
            r = self.__peer.rpc_delinstance(pid)
            yield r
            yield async .Coroutine.completion(r.status(), *r.args(),
                                              **r.kwds())
        else:
            yield async .Coroutine.failure('output not in use')
Beispiel #5
0
 def rpc_delinstance(self, arg):
     iid = paths.to_relative(paths.to_absolute(arg, scope=self.scope()))
     r = collection.Collection.rpc_delinstance(self, iid)
     yield r
     yield async .Coroutine.completion(r.status(), *r.args(), **r.kwds())