Пример #1
0
    def send_action(self, src, action, event):

        call = src.get_action_call(action)
        if (call):

            # analyze call to see if it's a legacy call
            # FIXME: remove eventually :)
            if (re.match("\w+:.*", call)):
                log("Deprecation: Please use new style call.",
                    is_warning = True)

                try:
                    legacy_args = event._args
                except:
                    legacy_args = []

                legacy_call = actionparser.parse(call)
                path = src.get_index_path()
                self.call_sensor(legacy_call, path, *legacy_args)

            else:
                src._setp("event", event)
                self.execute_callback_script(call, src)
Пример #2
0
    def handle_action(self, action, px, py, event):

        call = self.get_action_call(action)
        if (call):
            # analyze call to see if it's a legacy call
            # FIXME: remove eventually :)
            import re
            if (re.match("[\w\-]+:.*", call)):
                log("Deprecation: Please use new style call.",
                    is_warning = True)

                try:
                    legacy_args = event._args
                except:
                    legacy_args = []

                legacy_call = actionparser.parse(call)
                path = self.get_index_path()
                self._get_display().call_sensor(legacy_call, path,
                                                *legacy_args)

            else:
                self._setp("event", event)
                self._get_display().execute_callback_script(call, self)