Skip to content

Commit

Permalink
Merge pull request #107 from balshetzer/master
Browse files Browse the repository at this point in the history
Fix bugs that affected initialization on first startup
  • Loading branch information
balshetzer committed Jul 22, 2013
2 parents 6b0a558 + 976c47b commit 2ca64b6
Show file tree
Hide file tree
Showing 3 changed files with 17 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
9 changes: 9 additions & 0 deletions plover/test_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,15 @@ def test_suffix_folding(self):
self.translate(stroke('K-LG'))
self.assertTranslations(lt)

def test_suffix_folding_multi_stroke(self):
self.define('K/-L', 'look')
self.define('-G', '{^ing}')
lt = self.lt('K/-LG')
self.assertEqual(lt[0].english, 'look {^ing}')
self.translate(stroke('K'))
self.translate(stroke('-LG'))
self.assertTranslations(lt)

def test_suffix_folding_no_suffix(self):
self.define('K-L', 'look')
lt = self.lt('K-LG')
Expand Down

0 comments on commit 2ca64b6

Please sign in to comment.