Home | Trees | Indices | Help |
---|
|
1 # -*- coding: utf-8 -*- 2 # Elisa - Home multimedia server 3 # Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com). 4 # All rights reserved. 5 # 6 # This file is available under one of two license agreements. 7 # 8 # This file is licensed under the GPL version 3. 9 # See "LICENSE.GPL" in the root of this distribution including a special 10 # exception to use Elisa with Fluendo's plugins. 11 # 12 # The GPL part of Elisa is also available under a commercial licensing 13 # agreement from Fluendo. 14 # See "LICENSE.Elisa" in the root directory of this distribution package 15 # for details on that license. 16 17 18 __maintainer__ = 'Lionel Martin <lionel@fluendo.com>' 19 20 21 from elisa.core.component import Component 22 from elisa.core import common, config 2325 """ 26 DOCME 27 28 @ivar config_file: DOCME 29 @type config_file: 30 @cvar default_theme: DOCME 31 @type default_theme: 32 """ 33 34 default_theme = None 35 40 41 45 4810550 if config_file: 51 self._config_file = config_file 52 file_path = self._get_file_path(config_file) 53 self._theme_config = config.Config(file_path)54 5557 file_path = plugin_path 58 parts = plugin_path.split(':') 59 if len(parts) == 2: 60 plugin_name = parts[0] 61 relative_path = parts[1] 62 63 plugin_registry = common.application.plugin_registry 64 plugin = plugin_registry.plugin_classes[plugin_name] 65 file_path = plugin.get_resource_file(relative_path) 66 return file_path6769 """ 70 Return the absolute path to a file in the theme. 71 72 @param key: key (name) for the file 73 @type key: string 74 @param default_plugin_path: if the theme found None, use this one 75 @type default_plugin_path: string 76 @rtype: string 77 """ 78 # the format of default_plugin_path is plugin:directory/file 79 plugin_path = self._theme_config.get_option(key, 80 section='general', 81 default=None) 82 83 if plugin_path==None: 84 if default_plugin_path==None: 85 self.debug("Couldn't find '%s' returning unknown_icon" % key) 86 plugin_path = self._theme_config.get_option('unknown_icon', 87 section='general', 88 default=None) 89 else: 90 self._theme_config.set_option(key, 91 default_plugin_path, 92 section='general') 93 plugin_path=default_plugin_path 94 95 return self._get_file_path(plugin_path)96 9799 """ 100 DOCME 101 """ 102 if self._theme_config: 103 self._theme_config.write() 104 Component.save_config(self, application_config)
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Wed Jan 16 19:10:44 2008 | http://epydoc.sourceforge.net |