예제 #1
0
            def place(self):
                if idmode == "bound":
                    libcontext.socket(("entity", "bound", "property", "set"),
                                      socket_single_required(self.set_set_property))

                else:
                    libcontext.socket(("entity", "property", "set"), socket_single_required(self.set_set_property_for))
예제 #2
0
 def place(self):
     pluginclass = libcontext.pluginclasses.plugin_single_required
     socketclass = libcontext.socketclasses.socket_single_required
     libcontext.plugin(("bee", "segment", "connection", self.identifier), pluginclass(self.test))
     for connection in self.connection_output:
         libcontext.socket(("bee", "segment", "connection", get_ident(connection.identifier)),
                           socketclass(self.add_output))
예제 #3
0
 def place(self):
     libcontext.socket(("evin", ("input", "keyboard", "keyreleased")), socket_flag())
     if self.keycode not in asciilist:
         libcontext.socket(("evin", ("input", "keyboard", "extended")), socket_flag())
     place = keyboardsensor_base.place
     if python2: place = place.im_func
     place(self)
예제 #4
0
    def place(self):
        self.previous_state = False

        libcontext.socket(("evin", "add_listener"),
                          socket_single_required(self.set_add_listener))
        #Make sure we are enabled at startup
        libcontext.plugin(("bee", "init"), plugin_single_required(self.enable))
예제 #5
0
    def place(self):
        self.nextevent = ("on_next", self._beename, id(self))
        listener = plugin_single_required(("match", self.trig_outp, self.nextevent))
        libcontext.plugin(("evin", "listener"), listener)

        s = socket_single_required(self.set_event_next)
        libcontext.socket(("evin", "event", "next"), s)
예제 #6
0
 def place(self):
     if self.keycode not in asciilist:
         libcontext.socket(("evin", ("input", "keyboard", "extended")), socket_flag())
     place = keyboardsensor_base.place
     if python2:
         place = place.im_func
     place(self)
예제 #7
0
 def place(self):
     libcontext.plugin(("evin", "event"), plugin_supplier(self.read_event))
     libcontext.plugin(("evin", "event", "next"),
                       plugin_supplier(self.read_event_next))
     libcontext.plugin(("evin", "event", "next_tick"),
                       plugin_supplier(self.read_event_next_tick))
     libcontext.plugin(("evin", "read-exception"),
                       plugin_supplier(self.read_exception))
     libcontext.plugin(("evin", "add_listener"),
                       plugin_supplier(self.add_listener))
     libcontext.plugin(("evin", "remove_listener"),
                       plugin_supplier(self.remove_listener))
     libcontext.socket(("evin", "listener"),
                       socket_container(self.listener))
     libcontext.socket(("doexit"), socket_single_optional(self.set_doexit))
     libcontext.plugin(("eventhandler", "lock"),
                       plugin_supplier(self.eventhandler_lock))
     libcontext.plugin(("eventhandler", "unlock"),
                       plugin_supplier(self.eventhandler_lock))
     libcontext.plugin(("eventhandler", "raiser", "active"),
                       plugin_supplier(lambda: self.raiser))
     libcontext.plugin(("eventhandler", "raiser", "activate"),
                       plugin_supplier(self.raiser_activate))
     libcontext.plugin(("eventhandler", "raiser", "deactivate"),
                       plugin_supplier(self.raiser_deactivate))
예제 #8
0
    def place(self):
        if panda3d is None: raise ImportError("Cannot locate Panda3D")
        libcontext.socket(("panda", "noderoot", "loader"), socket_single_required(self._set_loader))

        libcontext.plugin(("canvas", "draw", ("object", "image")), plugin_supplier(self.draw_image))
        libcontext.plugin(("canvas", "update", ("object", "image")), plugin_supplier(self.update_image))
        libcontext.plugin(("canvas", "remove", ("object", "image")), plugin_supplier(self.remove_image))
예제 #9
0
 def place(self):
     libcontext.socket(
         ("evin", "add_listener"),
         socket_single_required(self.set_add_listener))
     libcontext.socket(
         ("evin", "remove_listener"),
         socket_single_required(self.set_remove_listener))
예제 #10
0
    def place(self):
        self.contextname = libcontext.get_curr_contextname()
        from libcontext.pluginclasses import plugin_supplier
        from libcontext.socketclasses import socket_container

        libcontext.socket(("evexc", "exception"), socket_container(self.add_target))
        libcontext.plugin(("evexc", "read-exception"), plugin_supplier(self.read_exception))
예제 #11
0
 def place(self):
     self.updaters2 = []
     self.updaters3 = []
     libcontext.socket(("canvas", "update2"),
                       socket_container(self.add_updater2))
     libcontext.socket(("canvas", "update3"),
                       socket_container(self.add_updater3))
예제 #12
0
 def place(self):
     socketclass = libcontext.socketclasses.socket_supplier
     libcontext.socket(("bee", "output", self.segmentname, self.type), socketclass(self.add_output))
     pluginclass = libcontext.pluginclasses.plugin_single_required
     for connection in self._connection:
         libcontext.plugin(("bee", "segment", "connection", get_ident(connection.identifier)),
                           pluginclass(self.output))
예제 #13
0
 def place(self):
     libcontext.socket("pacemaker",
                       socket_single_required(self.set_pacemaker))
     libcontext.socket(("evin", "add_listener"),
                       socket_single_required(self.set_add_listener))
     #Make sure we are enabled at startup
     libcontext.plugin(("bee", "init"), plugin_single_required(self.enable))
예제 #14
0
    def place(self):
        libcontext.plugin(("message", "subscribe"), plugin_supplier(self.subscribe))
        libcontext.plugin(("message", "unsubscribe"), plugin_supplier(self.unsubscribe))
        libcontext.plugin(("message", "publish"), plugin_supplier(self.publish))

        #Make sure we are enabled at startup
        libcontext.socket(("evin", "add_listener"), socket_single_required(self.set_add_listener))
        libcontext.plugin(("bee", "init"), plugin_single_required(self.enable))
예제 #15
0
    def place(self):
        libcontext.socket(("evin", "add_listener"), socket_single_required(self.set_add_listener))
        libcontext.socket(("evin", "remove_listener"), socket_single_required(self.set_remove_listener))

        self.listener = None

        if self.on:
            libcontext.plugin(("bee", "init"), plugin_single_required(self.m_start))
예제 #16
0
 def place(self):
     #Grab the hive's function for adding listeners
     libcontext.socket(("evin", "add_listener"), socket_single_required(self.set_add_listener))
     #Make sure we are enabled at startup
     libcontext.plugin(("bee", "init"), plugin_single_required(self.enable))
     #Declare flag sockets, to declare that we require mouse support
     # If there is no mouse support, an error will now be raised when the hive is closed
     libcontext.socket(("evin", ("input", "mouse")), socket_flag())
예제 #17
0
    def place(self):
        socketclass = libcontext.socketclasses.socket_single_optional
        libcontext.socket(("bee", "antenna", self.segmentname, self.type), socketclass(self.set_input))

        pluginclass = libcontext.pluginclasses.plugin_single_required
        for connection in self._connection:
            libcontext.plugin(("bee", "segment", "connection", get_ident(connection.identifier)),
                              pluginclass(self.input))
예제 #18
0
    def __place__(self):
        from libcontext.socketclasses import socket_container

        libcontext.socket(("evexc", "exception"), socket_container(self.add_catch_target))
        self._ev.place()
        self.bee.evexc = self._ev.context
        self.bee.catchfunc = self.catch
        self.bee.__place__()
예제 #19
0
    def place(self):
        self.nextevent = ("on_next", self._beename, id(self))
        listener = plugin_single_required(
            ("match", self.trig_outp, self.nextevent))
        libcontext.plugin(("evin", "listener"), listener)

        s = socket_single_required(self.set_event_next)
        libcontext.socket(("evin", "event", "next"), s)
예제 #20
0
 def place(self):
     pluginclass = libcontext.pluginclasses.plugin_supplier
     self.antenna_push_plugin = pluginclass(self.input)
     libcontext.plugin(("bee", "antenna", self.segmentname, self.type), self.antenna_push_plugin)
     socketclass = libcontext.socketclasses.socket_single_required
     for connection in self._connection:
         libcontext.socket(("bee", "segment", "connection", get_ident(connection.identifier)),
                           socketclass(self.add_connection))
예제 #21
0
    def place(self):
        assert self.player in ("White", "Black", "Both", None)
        self.board = pandachessboard(self)

        libcontext.socket(("eventhandler", "lock"),
                          socket_single_required(self.set_eventhandler_lock))

        libcontext.socket(("eventhandler", "unlock"),
                          socket_single_required(self.set_eventhandler_unlock))
예제 #22
0
    def place(self):
        pluginclass = libcontext.pluginclasses.plugin_supplier
        self.output_pull_plugin = pluginclass(self.output)
        libcontext.plugin(("bee", "output", self.segmentname, self.type), self.output_pull_plugin)

        socketclass = libcontext.socketclasses.socket_single_required
        connection = self._connection[0]
        libcontext.socket(("bee", "segment", "connection", get_ident(connection.identifier)),
                          socketclass(self.set_input))
예제 #23
0
    def place(self):
        plugin = plugin_supplier(self.do_bind)
        libcontext.plugin(("process", "launch"), plugin)

        socket = socket_single_required(self.set_register_hive)
        libcontext.socket("register_hive", socket)

        socket = socket_single_required(self.set_get_hive)
        libcontext.socket("get_hive", socket)
예제 #24
0
 def place(self):
     #Grab the hive's function for adding listeners
     libcontext.socket(("evin", "add_listener"),
                       socket_single_required(self.set_add_listener))
     #Make sure we are enabled at startup
     libcontext.plugin(("bee", "init"), plugin_single_required(self.enable))
     #Declare flag sockets, to declare that we require mouse support
     # If there is no mouse support, an error will now be raised when the hive is closed
     libcontext.socket(("evin", ("input", "mouse")), socket_flag())
예제 #25
0
    def place(self):
        s = socket_single_required(self.set_turn)
        libcontext.socket(("game", "turn"), s)

        s = socket_container(self.add_moveprocessor)
        libcontext.socket(("game", "process_move"), s)

        listener = plugin_single_required(("leader", self.move, "command"))
        libcontext.plugin(("evin", "listener"), listener)
예제 #26
0
            def place(self):
                if idmode == "bound":
                    libcontext.socket(
                        ("entity", "bound"),
                        socket_single_required(self.set_get_entity_name))

                libcontext.socket(
                    ("entity", "get", "Blender"),
                    socket_single_required(self.set_lookup_entity))
예제 #27
0
    def place(self):
        s = socket_single_required(self.set_turn)
        libcontext.socket(("game", "turn"), s)

        s = socket_container(self.add_moveprocessor)
        libcontext.socket(("game", "process_move"), s)

        listener = plugin_single_required(("leader", self.move, "command"))
        libcontext.plugin(("evin", "listener"), listener)
예제 #28
0
    def place(self):
        self.contextname = libcontext.get_curr_contextname()
        from libcontext.pluginclasses import plugin_supplier
        from libcontext.socketclasses import socket_container

        libcontext.socket(("evexc", "exception"),
                          socket_container(self.add_target))
        libcontext.plugin(("evexc", "read-exception"),
                          plugin_supplier(self.read_exception))
예제 #29
0
 def place(self):
     pluginclass = libcontext.pluginclasses.plugin_single_required
     socketclass = libcontext.socketclasses.socket_single_required
     libcontext.plugin(("bee", "segment", "connection", self.identifier),
                       pluginclass(self.test))
     for connection in self.connection_output:
         libcontext.socket(("bee", "segment", "connection",
                            get_ident(connection.identifier)),
                           socketclass(self.add_output))
예제 #30
0
    def __place__(self):
        from libcontext.socketclasses import socket_container

        libcontext.socket(("evexc", "exception"),
                          socket_container(self.add_catch_target))
        self._ev.place()
        self.bee.evexc = self._ev.context
        self.bee.catchfunc = self.catch
        self.bee.__place__()
예제 #31
0
 def place(self):
     socketclass = libcontext.socketclasses.socket_supplier
     libcontext.socket(("bee", "output", self.segmentname, self.type),
                       socketclass(self.add_output))
     pluginclass = libcontext.pluginclasses.plugin_single_required
     for connection in self._connection:
         libcontext.plugin(("bee", "segment", "connection",
                            get_ident(connection.identifier)),
                           pluginclass(self.output))
예제 #32
0
            def place(self):
                self.pending_triggers = []
                libcontext.plugin(("bee", "init"),
                                  plugin_single_required(self.enable))

                libcontext.socket("pacemaker",
                                  socket_single_required(self.set_pacemaker))
                libcontext.socket(
                    ("evin", "add_listener"),
                    socket_single_required(self.set_add_listener))
예제 #33
0
    def place(self):
        socketclass = libcontext.socketclasses.socket_single_optional
        libcontext.socket(("bee", "antenna", self.segmentname, self.type),
                          socketclass(self.set_input))

        pluginclass = libcontext.pluginclasses.plugin_single_required
        for connection in self._connection:
            libcontext.plugin(("bee", "segment", "connection",
                               get_ident(connection.identifier)),
                              pluginclass(self.input))
예제 #34
0
 def place(self):
     pluginclass = libcontext.pluginclasses.plugin_supplier
     self.antenna_push_plugin = pluginclass(self.input)
     libcontext.plugin(("bee", "antenna", self.segmentname, self.type),
                       self.antenna_push_plugin)
     socketclass = libcontext.socketclasses.socket_single_required
     for connection in self._connection:
         libcontext.socket(("bee", "segment", "connection",
                            get_ident(connection.identifier)),
                           socketclass(self.add_connection))
예제 #35
0
            def place(self):
                if idmode == "bound":
                    libcontext.socket(
                        ("entity", "bound", "parent", "set"),
                        socket_single_required(self.set_parent_set))

                else:
                    libcontext.socket(
                        ("entity", "parent", "set"),
                        socket_single_required(self.set_parent_set_for))
예제 #36
0
            def place(self):
                if idmode == "bound":
                    libcontext.socket(
                        ("entity", "bound", "property", "get"),
                        socket_single_required(self.set_get_property))

                else:
                    libcontext.socket(
                        ("entity", "property", "get"),
                        socket_single_required(self.set_get_property_for))
예제 #37
0
 def place(self):
     libcontext.plugin(("evout", ("input", "command")), plugin_flag())
     libcontext.socket(("evout", "scheduler"),
                       socket_container(self.add_target))
     libcontext.socket(("command", "new_command"),
                       socket_single_required(self.set_new_command))
     libcontext.plugin("startupfunction",
                       plugin_single_required(self.startup))
     libcontext.plugin("cleanupfunction",
                       plugin_single_required(self.restore_terminal))
예제 #38
0
    def place(self):
        libcontext.socket(("evin", "add_listener"),
                          socket_single_required(self.set_add_listener))
        libcontext.socket(("evin", "remove_listener"),
                          socket_single_required(self.set_remove_listener))

        self.listener = None

        if self.on:
            libcontext.plugin(("bee", "init"),
                              plugin_single_required(self.m_start))
예제 #39
0
    def place(self):
        pluginclass = libcontext.pluginclasses.plugin_supplier
        self.output_pull_plugin = pluginclass(self.output)
        libcontext.plugin(("bee", "output", self.segmentname, self.type),
                          self.output_pull_plugin)

        socketclass = libcontext.socketclasses.socket_single_required
        connection = self._connection[0]
        libcontext.socket(
            ("bee", "segment", "connection", get_ident(connection.identifier)),
            socketclass(self.set_input))
예제 #40
0
파일: io.py 프로젝트: agoose77/hivesystem
 def place0(self):
     self.connector.place()
     self.connector.parent = self
     for k in self.connector.context.plugins.keys():
         if k[1] == self.inout[:-1]:
             p = ("bee", k[1], self.hivename, self.ttype)
             libcontext.plugin(p, self.connector.context.plugins[k][0])
     for k in self.connector.context.sockets.keys():
         if k[1] == self.inout[:-1]:
             s = ("bee", k[1], self.hivename, self.ttype)
             libcontext.socket(s, self.connector.context.sockets[k][0])
예제 #41
0
    def place(self):
        if panda3d is None: raise ImportError("Cannot locate Panda3D")
        libcontext.socket(("panda", "noderoot", "loader"),
                          socket_single_required(self._set_loader))

        libcontext.plugin(("canvas", "draw", ("object", "image")),
                          plugin_supplier(self.draw_image))
        libcontext.plugin(("canvas", "update", ("object", "image")),
                          plugin_supplier(self.update_image))
        libcontext.plugin(("canvas", "remove", ("object", "image")),
                          plugin_supplier(self.remove_image))
예제 #42
0
파일: io.py 프로젝트: agoose77/hivesystem
 def place0(self):
     self.connector.place()
     self.connector.parent = self
     for k in self.connector.context.plugins.keys():
         if k[1] == self.inout[:-1]:
             p = ("bee", k[1], self.hivename, self.ttype)
             libcontext.plugin(p, self.connector.context.plugins[k][0])
     for k in self.connector.context.sockets.keys():
         if k[1] == self.inout[:-1]:
             s = ("bee", k[1], self.hivename, self.ttype)
             libcontext.socket(s, self.connector.context.sockets[k][0])
예제 #43
0
파일: bind.py 프로젝트: agoose77/hivesystem
                        def place(bridge):
                            self.on_place()

                            # Expose these to the hive, per class
                            s = libcontext.socketclasses.socket_supplier(
                                bridge.startup_functions.append)
                            libcontext.socket("startupfunction", s)

                            s = libcontext.socketclasses.socket_supplier(
                                bridge.cleanup_functions.append)
                            libcontext.socket("cleanupfunction", s)
예제 #44
0
 def place(self):
     pluginclass = libcontext.pluginclasses.plugin_single_required
     socketclass = libcontext.socketclasses.socket_single_required
     for onr, connection in enumerate(self._outputs):
         func = functools.partial(self.set_output, onr)
         ident = self.identifier
         if ident is None: ident = str(id(self))
         identifier = ident + ":" + str(onr + 1)
         libcontext.socket(("bee", "segment", "connection", identifier), socketclass(func))
     for connection in self.connection_input:
         libcontext.plugin(("bee", "segment", "connection", get_ident(connection.identifier)),
                           pluginclass(self.output))
예제 #45
0
    def place(self):
        init()
        listener = plugin_single_required(("trigger", self.send_input, "send_input"))
        libcontext.plugin(("evin", "listener"), listener)

        libcontext.socket(("evout", "scheduler"), socket_container(self.add_target))
        libcontext.plugin(("evout", ("input", "keyboard")), plugin_flag())
        libcontext.plugin(("evout", ("input", "keyboard", "extended")), plugin_flag())
        libcontext.plugin(("evout", ("input", "keyboard", "keyreleased")), plugin_flag())
        libcontext.plugin(("evout", ("input", "mouse")), plugin_flag())

        libcontext.plugin(("evout", ("input", "get_mouse")), plugin_supplier(self.get_mouse))
예제 #46
0
    def place(self):
        libcontext.plugin(("message", "subscribe"),
                          plugin_supplier(self.subscribe))
        libcontext.plugin(("message", "unsubscribe"),
                          plugin_supplier(self.unsubscribe))
        libcontext.plugin(("message", "publish"),
                          plugin_supplier(self.publish))

        #Make sure we are enabled at startup
        libcontext.socket(("evin", "add_listener"),
                          socket_single_required(self.set_add_listener))
        libcontext.plugin(("bee", "init"), plugin_single_required(self.enable))
예제 #47
0
 def place(self):
     pluginclass = libcontext.pluginclasses.plugin_single_required
     socketclass = libcontext.socketclasses.socket_single_required
     ident = self.identifier
     if ident is None: ident = str(id(self))
     identifier = ident + ":1"
     libcontext.plugin(("bee", "segment", "connection", identifier), pluginclass(self.get_input1))
     identifier = ident + ":2"
     libcontext.plugin(("bee", "segment", "connection", identifier), pluginclass(self.get_input2))
     for connection in self.connection_output:
         libcontext.socket(("bee", "segment", "connection", get_ident(connection.identifier)),
                           socketclass(self.add_output))
예제 #48
0
 def place(self):
     for binder in self.bindobject.binder_instances:
         if getattr(self.bindobject, binder.parameter_name) != binder.parameter_value:
             continue
         # print binder.parameter_name, binder.parametervalue, str(binder.binder_drone_instance.__beename__), tuple(binder.antennanames)
         if len(binder.antenna_names):
             if binder.antenna_names != ["bindname"]:
                 raise TypeError("Static binder worker cannot provide bindantennas %s" % list(binder.antenna_names))
             binder.binder_drone_instance.bind(self.bindobject, bindname=self.bindobject.b_bindname)
         else:
             binder.binder_drone_instance.bind(self.bindobject)
     s = libcontext.socketclasses.socket_supplier(lambda f: self.bindobject.startupfunctions.append(f))
     libcontext.socket("startupfunction", s)
예제 #49
0
    def place(self):
        s = socket_single_required(self.set_action1_anim)
        libcontext.socket(("action1", "play", "animation"), s)
        s = socket_single_required(self.set_action1_sound)
        libcontext.socket(("action1", "play", "sound"), s)

        s = socket_single_required(self.set_action2_play)
        libcontext.socket(("action2", "play", "action"), s)

        s = socket_single_required(self.set_action3_anim)
        libcontext.socket(("action3", "play", "animation"), s)
        s = socket_single_required(self.set_action3_sound)
        libcontext.socket(("action3", "play", "sound"), s)
예제 #50
0
파일: ray.py 프로젝트: agoose77/hivesystem
            def place(self):
                if idmode == "bound" and use_entity_position:
                    libcontext.socket(("entity", "bound"), socket_single_required(self.set_get_entity_name))

                libcontext.socket(("collision", "ray_test"), socket_single_required(self.set_ray_test))
                libcontext.socket(("entity", "property", "get"), socket_single_required(self.set_get_property))
                libcontext.socket(("entity", "material", "get"), socket_single_required(self.set_get_property))
예제 #51
0
    def place(self):
        if panda3d is None: raise ImportError("Cannot locate Panda3D")
        libcontext.socket(("panda", "window"), socket_single_required(self.get_window))

        libcontext.socket(("evout", "scheduler"), socket_container(self.add_target))
        libcontext.plugin(("evout", ("input", "keyboard")), plugin_flag())
        libcontext.plugin(("evout", ("input", "keyboard", "extended")), plugin_flag())
        libcontext.plugin(("evout", ("input", "keyboard", "keyreleased")), plugin_flag())
        libcontext.plugin(("evout", ("input", "mouse")), plugin_flag())
        libcontext.plugin(("evout", ("input", "mouse", "wheel")), plugin_flag())

        libcontext.plugin(("evout", ("input", "get_mouse")), plugin_supplier(self.get_mouse))
        libcontext.plugin("startupfunction", plugin_single_required(self.startup))
        libcontext.plugin("cleanupfunction", plugin_single_required(self.destroy))
예제 #52
0
    def place(self):
        if not hasattr(self, "parent"): return  # KLUDGE
        p = libcontext.pluginclasses.plugin_single_required(self.parent)
        libcontext.import_plugin(self.parent.parent.context, ("pin", "mediator"))
        libcontext.import_socket(self.parent.parent.context, ("pin", "run"))
        libcontext.import_socket(self.parent.parent.context, ("pin", "push_input"))
        libcontext.import_socket(self.parent.parent.context, ("pin", "pull_input"))
        libcontext.import_socket(self.parent.parent.context, ("pin", "push_output"))
        libcontext.import_socket(self.parent.parent.context, ("pin", "pull_output"))

        libcontext.plugin(("pin", "run"), p)

        s = libcontext.socketclasses.socket_single_required(self._set_mediator)
        libcontext.socket(("pin", "mediator"), s)
예제 #53
0
 def place(self):
     libcontext.plugin(("evin", "event"), plugin_supplier(self.read_event))
     libcontext.plugin(("evin", "event", "next"), plugin_supplier(self.read_event_next))
     libcontext.plugin(("evin", "event", "next_tick"), plugin_supplier(self.read_event_next_tick))
     libcontext.plugin(("evin", "read-exception"), plugin_supplier(self.read_exception))
     libcontext.plugin(("evin", "add_listener"), plugin_supplier(self.add_listener))
     libcontext.plugin(("evin", "remove_listener"), plugin_supplier(self.remove_listener))
     libcontext.socket(("evin", "listener"), socket_container(self.listener))
     libcontext.socket(("doexit"), socket_single_optional(self.set_doexit))
     libcontext.plugin(("eventhandler", "lock"), plugin_supplier(self.eventhandler_lock))
     libcontext.plugin(("eventhandler", "unlock"), plugin_supplier(self.eventhandler_lock))
     libcontext.plugin(("eventhandler", "raiser", "active"), plugin_supplier(lambda: self.raiser))
     libcontext.plugin(("eventhandler", "raiser", "activate"), plugin_supplier(self.raiser_activate))
     libcontext.plugin(("eventhandler", "raiser", "deactivate"), plugin_supplier(self.raiser_deactivate))
예제 #54
0
            def place(self):
                if idmode == "bound":
                    libcontext.socket(("entity", "bound", "collisions"), socket_single_required(self.set_get_collisions))

                libcontext.socket(("entity", "collisions"), socket_single_required(self.set_get_collisions_for))
                libcontext.socket(("entity", "property", "get"), socket_single_required(self.set_get_property))
                libcontext.socket(("entity", "material", "get"), socket_single_required(self.set_get_property))
예제 #55
0
 def place(self):
     pluginclass = libcontext.pluginclasses.plugin_single_required
     cb = getattr(self, "callback")[0]
     if self.intuple:
         r = self.runtuple
     else:
         r = self.runsingle
     p = pluginclass(functools.partial(r, cb))
     for connection in self._connection_input:
         libcontext.plugin(("bee", "segment", "connection", get_ident(connection.identifier)), p)
     socketclass = libcontext.socketclasses.socket_single_required
     for connection in self._connection_output:
         libcontext.socket(("bee", "segment", "connection", get_ident(connection.identifier)),
                           socketclass(self.add_target))
예제 #56
0
    def place(self):
        libcontext.socket(("process", "bound"), socket_single_optional(self.set_get_process_name))
        libcontext.plugin(("bee", "init"), plugin_single_required(self.enable))
        libcontext.socket(("evin", "add_listener"), socket_single_required(self.set_add_listener))
        libcontext.socket(("message", "subscribe"), socket_single_required(self.set_subscribe))
        libcontext.socket(("message", "unsubscribe"), socket_single_required(self.set_unsubscribe))

        libcontext.plugin("cleanupfunction", plugin_single_required(self.on_cleanup))
예제 #57
0
 def place(self):
     libcontext.plugin(("command", "new_command"), plugin_supplier(self.new_command))
     libcontext.socket("startupfunction", socket_container(self.addstartupfunction))
     libcontext.socket("cleanupfunction", socket_container(self.addcleanupfunction))
     libcontext.plugin("exit", plugin_supplier(self.exit))
     libcontext.plugin("stop", plugin_supplier(self.exit))
     libcontext.plugin("display", plugin_supplier(self.display))
     libcontext.plugin("watch", plugin_supplier(self.watch))
     libcontext.socket("pacemaker", socket_single_required(self.set_pacemaker))
     libcontext.socket(("evin", "event"), socket_container(self.add_eventreader))
     libcontext.plugin("doexit", plugin_supplier(lambda: self.doexit))
예제 #58
0
파일: bind.py 프로젝트: agoose77/hivesystem
    def bind(self, binderworker, bindname):
        self.binderworker = binderworker

        # In case any other binders want event functions
        # Register this bind_class (which belongs to the hive BINDER only once)
        if self.listener not in binderworker.eventfuncs:
            binderworker.eventfuncs.append(self.listener)

        # So we know which processes exist
        self.bindnames.add(bindname)

        # Individual event handler of the BOUND class (multiple bound hives possible)
        def set_handler(func):
            binderworker.event_handlers[bindname] = func
            # Active state
            binderworker.handler_states[bindname] = True

        s = libcontext.socketclasses.socket_single_required(set_handler)
        libcontext.socket(("evin", "event"), s)