diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-10-05 11:26:02 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-10-05 11:26:02 (GMT) |
commit | b3abf30decf9804b492f938daaedd04cc2a9aed0 (patch) | |
tree | 0e2a7a1785dc698b1afd063bb36748e031d4e5cb /sugar/graphics/style.py | |
parent | 3972ff86511a09ff4e86e8f293d8bee0122667ea (diff) |
Improve stylesheet loading
Diffstat (limited to 'sugar/graphics/style.py')
-rw-r--r-- | sugar/graphics/style.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sugar/graphics/style.py b/sugar/graphics/style.py index 4b1bc53..ae1e424 100644 --- a/sugar/graphics/style.py +++ b/sugar/graphics/style.py @@ -1,5 +1,12 @@ _styles = {} +def load_stylesheet(module): + for objname in dir(module): + if not objname.startswith('_'): + obj = getattr(module, objname) + if isinstance(obj, dict): + register_stylesheet(objname.replace('_', '.'), obj) + def register_stylesheet(name, style): _styles[name] = style |