Part of elisa.plugins.pigment.widgets.theme View In Hierarchy
Known subclasses: elisa.plugins.pigment.tests.widgets.test_theme.ThemeCacheMock
A basic theme will be built from the default configuration files, providing necessary style information for the widgets: without that, widgets won't work.
Instance Variables | widget_styles | the styles for the widgets, for each state
(type: dict of states to elisa.plugins.pigment.widgets.Style s
) |
stock_resources | the map of resource names to file paths (type: a dict strings to strings ) | |
fallback_themes | a dictionary of plugin names to Themes, cashing information necessary to do
the right fallback for missing resources
(type: dictionary of strings to elisa.core.components.theme.Theme
) |
Line # | Kind | Name | Docs |
---|---|---|---|
81 | Method | __init__ | DOCME |
118 | Method | start_monitoring | Undocumented |
136 | Method | stop_monitoring | Undocumented |
152 | Method | __reduce__ | Undocumented |
156 | Method | __getstate__ | Undocumented |
165 | Method | __setstate__ | Undocumented |
348 | Class Method | load_from_module | Build a elisa.plugins.pigment.widgets.Theme object using
the |
397 | Method | update | Merge in-place another theme. |
406 | Method | merge | Merge with another theme, returning a new one. |
446 | Method | get_style_for_widget | Get the style for a widget class in the specified state. |
474 | Method | get_resource | Get the named resources, doing a lookup into the plugins' defaults if not |
496 | Method | lookup | Dynamically search for the named resource ('style' or 'resource'). |
552 | Method | __repr__ | Undocumented |
560 | Class Method | get_default | Get the default theme. |
570 | Static Method | set_default | Set the default theme. |
88 | Method | _init | Undocumented |
109 | Method | _notify_cb | Undocumented |
176 | Method | _load_css | Undocumented |
190 | Method | _get_cache_directory | Undocumented |
199 | Method | _get_cached_file | Undocumented |
206 | Method | _get_from_cache | Undocumented |
250 | Method | _add_to_cache | Undocumented |
259 | Method | _get_styles | Undocumented |
302 | Method | _get_resources | Undocumented |
333 | Method | _init_styles | Read the configuration file and fill up the widgets styles. |
340 | Method | _init_resources | Read the configuration file and fill up the stock resources. |
elisa.plugins.pigment.widgets.Theme
object using
the 'styles.conf' and 'resources.conf' files found in the specified
module.Parameters | module_name | the module to search, in the absolute dotted notation
(type: str
) |
Returns | the new theme, or None
(type: elisa.plugins.pigment.widgets.Theme
) |
Parameters | other | the theme from which to update
(type: elisa.plugins.pigment.widgets.Theme
) |
The new theme will have all the "properties" of the current style, with replaced values from the second, plus further "properties" coming from the other theme.
Parameters | other | the theme to merge
(type: elisa.plugins.pigment.widgets.Theme
) |
inplace | whether to build another theme, or update the current one
(type: bool
) | |
Returns | the new theme
(type: elisa.plugins.pigment.widgets.Theme
) |
Parameters | widget | the classname of the widget
(type: str
) |
state | the state for which we want to retrieve the style (one of elisa.plugins.pigment.widgets.const .STATE_*)
(type: int
) | |
Returns | the associated style, or None
(type: elisa.plugins.pigment.widgets.Style
) |
Parameters | name | the name of the resource
(type: str
) |
search | whether to do the lookup into the plugins defaults
(type: bool
) |
If a suitable module is found during the search, a Theme
object will be built and cached for later use: it will be stored in a
dictionary indexed by absolute module names (in the Python dotted
notation).
Parameters | name | the full qualified name to look for (e.g.:
'elisa.plugins.pigment.widgets.Button' or 'elisa.plugins.shelf.icon')
(type: str
) |
type | 'style' or 'resource'
(type: str
) | |
state | the state of the widget. Only used if type == 'style'. One of elisa.plugins.pigment.widgets.const .STATE_*
(type: int
) | |
Returns | the resource found (filepath or style), if any
(type: str or elisa.plugins.pigment.widgets.Style or
None
) |