diff options
author | mathieui <mathieui@mathieui.net> | 2011-11-07 19:56:59 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2011-11-07 19:56:59 +0100 |
commit | 7e78353621f530cdfa0c5280386512aa40a36048 (patch) | |
tree | d81320058359fd23acb5b1cd168ae5d21beb7aea /src/theming.py | |
parent | 153137e5d2e610afa4a7ca0ce2e3855ff1dec253 (diff) | |
download | poezio-7e78353621f530cdfa0c5280386512aa40a36048.tar.gz poezio-7e78353621f530cdfa0c5280386512aa40a36048.tar.bz2 poezio-7e78353621f530cdfa0c5280386512aa40a36048.tar.xz poezio-7e78353621f530cdfa0c5280386512aa40a36048.zip |
Add a warning in case of theme not found, and now unsetting 'theme',
setting it to 'default' or a number of spaces has the same effect
Diffstat (limited to 'src/theming.py')
-rw-r--r-- | src/theming.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/theming.py b/src/theming.py index 4bfdad42..0a7ab22d 100644 --- a/src/theming.py +++ b/src/theming.py @@ -240,16 +240,17 @@ def reload_theme(): os.makedirs(themes_dir) except OSError: pass - theme_name = config.get('theme', '') - if not theme_name: + theme_name = config.get('theme', 'default') + global theme + if theme_name == 'default' or not theme_name.strip(): + theme = Theme() return try: file_path = os.path.join(themes_dir, theme_name)+'.py' log.debug('Theme file to load: %s' %(file_path,)) new_theme = imp.load_source('theme', os.path.join(themes_dir, theme_name)+'.py') - except: # TODO warning: theme not found - return - global theme + except: + return 'Theme not found' theme = new_theme.theme if __name__ == '__main__': |