示例#1
0
    def available_leds(self):
        if self._leds is not None:
            return self._leds

        self._leds = OrderedDict()
        for name, t_dict in sorted(self.driver.AvailableLEDs.items()):
            traits = dict_as_class_traits(t_dict)
            self._leds[name] = RemoteTraits(name.lower(), \
                    "LED: %s" % name.title(), None, None, traits)

        return self._leds
示例#2
0
    def available_fx(self):
        if self._fx is not None:
            return self._fx

        self._fx = OrderedDict()
        for name, t_dict in sorted(self.driver.AvailableFX.items()):
            traits = dict_as_class_traits(t_dict)
            if hasattr(traits, 'hidden') and traits.hidden:
                continue

            self._fx[name] = RemoteTraits(name, \
                traits.description, None, None, traits)

        return self._fx
示例#3
0
    def renderer_info(self):
        if self._renderer_info is not None:
            return self._renderer_info

        avail = self.driver.AvailableRenderers
        if avail is None or len(avail) == 0:
            return None

        sar = OrderedDict(
            sorted(avail.items(),
                   key=lambda k_v: k_v[1]['meta']['display_name']))
        exploded = OrderedDict()
        for name, t_anim in sar.items():
            meta = t_anim['meta']
            rt = RemoteTraits(meta['display_name'], meta['description'],
                              meta['author'], meta['version'],
                              dict_as_class_traits(t_anim['traits']))
            exploded[name] = rt
            self._aliases[name] = rt.name.replace(' ', '_').lower()

        self._renderer_info = exploded
        return self._renderer_info