Skip to content

Commit

Permalink
Fix bug that did not properly initialize configs on first startup
Browse files Browse the repository at this point in the history
  • Loading branch information
balshetzer committed Jul 22, 2013
1 parent 4f0c054 commit 976c47b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions plover/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ def __init__(self, config):
app.init_engine(self.steno_engine, self.config)
break
except InvalidConfigurationError as e:
self.show_alert(unicode(e))
self._show_alert(unicode(e))
dlg = ConfigurationDialog(self.steno_engine,
self.config,
parent=self)
re = dlg.ShowModel()
ret = dlg.ShowModal()
if ret == wx.ID_CANCEL:
self._quit()
return
Expand Down
11 changes: 6 additions & 5 deletions plover/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ def init_config_dir():
This usually only does anything the first time plover is launched.
"""

# Create the configuration directory if needed.
if not os.path.exists(CONFIG_DIR):
os.makedirs(CONFIG_DIR)
# Copy the default dictionary to the configuration directory.
shutil.copyfile(os.path.join(ASSETS_DIR, DEFAULT_DICTIONARY_FILE),
os.path.join(CONFIG_DIR,
DEFAULT_DICTIONARY_FILE))

# Copy the default dictionary to the configuration directory.
if not os.path.exists(DEFAULT_DICTIONARY_FILE):
dict_filename = os.path.basename(DEFAULT_DICTIONARY_FILE)
shutil.copyfile(os.path.join(ASSETS_DIR, dict_filename),
DEFAULT_DICTIONARY_FILE)

# Create a default configuration file if one doesn't already
# exist.
Expand Down

0 comments on commit 976c47b

Please sign in to comment.