From 976c47b79babf81b536cc5964464a80c242dead0 Mon Sep 17 00:00:00 2001 From: Hesky Fisher Date: Mon, 22 Jul 2013 08:12:19 -0400 Subject: [PATCH] Fix bug that did not properly initialize configs on first startup --- plover/gui/main.py | 4 ++-- plover/main.py | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plover/gui/main.py b/plover/gui/main.py index 3b112a6f2..73be12687 100644 --- a/plover/gui/main.py +++ b/plover/gui/main.py @@ -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 diff --git a/plover/main.py b/plover/main.py index 62484a04c..99628e7ef 100644 --- a/plover/main.py +++ b/plover/main.py @@ -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.