コード例 #1
0
ファイル: config.py プロジェクト: 5up3rD4n1/spreads
    def templates(self):
        """ Get all available configuration templates.

        :rtype: dict

        """
        import spreads.plugin
        templates = {'core': CORE_OPTIONS}
        if 'driver' in self.keys():
            driver_name = self["driver"].get()
            templates['device'] = (spreads.plugin.get_driver(driver_name)
                                   .configuration_template())
        plugins = spreads.plugin.get_plugins(*self["plugins"].get())
        for name, plugin in plugins.iteritems():
            tmpl = plugin.configuration_template()
            if tmpl:
                templates[name] = tmpl
        return templates
コード例 #2
0
ファイル: config.py プロジェクト: jamescr/spreads
    def templates(self):
        """ Get all available configuration templates.

        :rtype: dict

        """
        import spreads.plugin
        templates = {'core': CORE_OPTIONS}
        if 'driver' in self.keys():
            driver_name = self["driver"].get()
            templates['device'] = (spreads.plugin.get_driver(
                driver_name).configuration_template())
        plugins = spreads.plugin.get_plugins(*self["plugins"].get())
        for name, plugin in plugins.iteritems():
            tmpl = plugin.configuration_template()
            if tmpl:
                templates[name] = tmpl
        return templates
コード例 #3
0
    def load_templates(self):
        """ Get all available configuration templates from the activated
        plugins.

        :returns:   Mapping from plugin name to template mappings.
        :rtype:     dict unicode -> (dict unicode ->
                    :py:class:`OptionTemplate`)
        """
        import spreads.plugin
        self.templates = {}
        self.templates['core'] = CORE_OPTIONS
        if 'driver' in self.keys():
            driver_name = self["driver"].get()
            self.templates['device'] = (spreads.plugin.get_driver(
                driver_name).configuration_template())
        plugins = spreads.plugin.get_plugins(*self["plugins"].get())
        for name, plugin in plugins.iteritems():
            tmpl = plugin.configuration_template()
            if tmpl:
                self.templates[name] = tmpl
        return self.templates
コード例 #4
0
ファイル: config.py プロジェクト: gareth8118/spreads
    def load_templates(self):
        """ Get all available configuration templates from the activated
        plugins.

        :returns:   Mapping from plugin name to template mappings.
        :rtype:     dict unicode -> (dict unicode ->
                    :py:class:`OptionTemplate`)
        """
        import spreads.plugin
        self.templates = {}
        self.templates['core'] = CORE_OPTIONS
        if 'driver' in self.keys():
            driver_name = self["driver"].get()
            self.templates['device'] = (
                spreads.plugin.get_driver(driver_name)
                       .configuration_template())
        plugins = spreads.plugin.get_plugins(*self["plugins"].get())
        for name, plugin in plugins.iteritems():
            tmpl = plugin.configuration_template()
            if tmpl:
                self.templates[name] = tmpl
        return self.templates