Пример #1
0
    def build_maps(names, base_path):
        results = {}
        for name in names:
            if name == "Timestamp":
                continue
            name_parts = name.split("/")
            point = name_parts[-1]
            topic = normtopic(base_path + '/' + "/".join(name_parts[:-1]))

            results[name] = (topic, point)

        return results
Пример #2
0
    def build_maps(names, base_path):
        results = {}
        for name in names:
            if name == "Timestamp":
                continue
            name_parts = name.split("/")
            point = name_parts[-1]
            topic = normtopic(base_path + '/' + "/".join(name_parts[:-1]))

            results[name] = (topic, point)

        return results
Пример #3
0
    def build_maps(self, fieldnames, base_path):
        """
        Creates name an topic tree based upon the passed fieldnames.

        Topics are generated based upon the topic separator and the field name passed.  All topics
        will be separated by the / after they are created.  The topic can then be used to determine
        the points associated with that topic.
        """
        results = {}
        for name in fieldnames:
            if name == "Timestamp":
                continue
            name_parts = name.split(self._topic_separator)
            point = name_parts[-1]
            topic = normtopic(base_path + '/' + '/'.join(name_parts[:-1]))

            results[name] = (topic, point)

        return results
Пример #4
0
 def push_result_topic_pair(self, prefix, point, headers, *args):
     topic = normtopic('/'.join([prefix, point]))
     self.vip.pubsub.publish('pubsub', topic, headers, message = args)
Пример #5
0
 def push_result_topic_pair(self, prefix, point, headers, *args):
     topic = normtopic('/'.join([prefix, point]))
     self.vip.pubsub.publish('pubsub', topic, headers, message=args)
Пример #6
0
 def push_result_topic_pair(self, prefix, point, headers, *args):
     topic = normtopic("/".join([prefix, point]))
     self.publish_json(topic, headers, *args)
Пример #7
0
 def push_result_topic_pair(self, prefix, point, headers, *args):
     topic = normtopic('/'.join([prefix, point]))
     self.publish_json(topic, headers, *args)