Skip to content

Commit

Permalink
Merge pull request #506 from mathoudebine/fix/453-attributeerror-none…
Browse files Browse the repository at this point in the history
…type-object-has-no-attribute-get
  • Loading branch information
mathoudebine authored Apr 28, 2024
2 parents 925ac9b + bfa9457 commit 9bc8e6f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,16 @@ def load_config_values(self):
with open("config.yaml", "rt", encoding='utf8') as stream:
self.config, ind, bsi = ruamel.yaml.util.load_yaml_guess_indent(stream)

# Check if theme is valid
if get_theme_data(self.config['config']['THEME']) is None:
# Theme from config.yaml is not valid: use first theme available default size 3.5"
self.config['config']['THEME'] = get_themes(SIZE_3_5_INCH)[0]

try:
self.theme_cb.set(self.config['config']['THEME'])
except:
self.theme_cb.current(0)
# self.load_theme_size()
self.theme_cb.set("")

self.load_theme_preview()

try:
Expand Down Expand Up @@ -361,7 +366,6 @@ def save_config_values(self):
ruamel.yaml.YAML().dump(self.config, file)

def on_theme_change(self, e=None):
# self.load_theme_size()
self.load_theme_preview()

def on_theme_editor_click(self):
Expand Down

0 comments on commit 9bc8e6f

Please sign in to comment.