Skip to content

Commit

Permalink
fixed crash when using older themes with missing keys, fixes Bug:#426490
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Heinle committed Sep 21, 2009
2 parents bd32b09 + 860971f commit f599e71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -12,6 +12,7 @@ User visible changes
Bugfixes
--------
* fixed crash on startup if more than 1 language in $LANGUAGE (LP:#367990, #365477)
* fixed crash when using older themes with missing keys (LP:#426490)

Noteable background changes
---------------------------
Expand Down
10 changes: 10 additions & 0 deletions PyRoom/gui.py
Expand Up @@ -63,6 +63,16 @@ def __init__(self, theme_name):
theme_file.read(theme_filename)
self.update(theme_file.items('theme'))

def __getitem__(self, item):
"""get default values from our default theme
this is to handle custom themes from older versions"""
try:
return dict.__getitem__(self, item)
except KeyError:
default_theme = Theme('green')
return default_theme[item]

def _lookup_theme(self, theme_name):
"""lookup theme_filename for given theme_name
Expand Down

0 comments on commit f599e71

Please sign in to comment.