-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* avoid importing add-on modules on installTasks.py, this should fix #85
. * now the availability of the libraries should be detected properly during add-on installation. * small correction on _settingsDB.py
- Loading branch information
Showing
2 changed files
with
22 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
# -*- coding: UTF-8 -*- | ||
#Copyright (C) 2009 - 2019 David CM, released under the GPL. | ||
# Author: David CM <[email protected]> and others. | ||
|
||
# note: this file doesn't get settings from the base profile to avoid issues when updating from older versions. | ||
|
||
from logHandler import log | ||
from synthDrivers._settingsDB import appConfig, DEFAULT_LIB_FOLDER | ||
import globalVars, gui, os, shutil, wx, addonHandler | ||
|
||
import config, globalVars, gui, os, shutil, wx, addonHandler | ||
|
||
addonHandler.initTranslation() | ||
|
||
|
||
|
@@ -20,19 +23,26 @@ def preserveFiles(addonName, folder): | |
shutil.rmtree(tempFolder) | ||
os.rename(absFolderPath, tempFolder) | ||
|
||
msg="" | ||
if not os.path.exists(os.path.join(os.path.dirname(__file__), 'synthDrivers', appConfig.TTSPath, appConfig.dllName)): | ||
# Translators: the message shown if the driver can't find libraries during installation. | ||
msg = _("""The synthesizer won't be available until you set IBMTTS files. NVDA won't show this synthesizer in teh synthesizers lists because you need to set the IBMTTS files location first. | ||
To do it open the NVDA settings dialog, select IBMTTS category and use the "Browse for IBMTTS library" button to select the IBMTTS files folder.\n""") | ||
try: | ||
TTSPath = config.conf['ibmeci']['TTSPath'] | ||
dllName = config.conf['ibmeci']['dllName'] | ||
except: | ||
TTSPath = "ibmtts" | ||
dllName = "eci.dll" | ||
|
||
|
||
def onInstall(): | ||
try: | ||
preserveFiles("IBMTTS", fr"synthDrivers\{DEFAULT_LIB_FOLDER}") | ||
preserveFiles("IBMTTS", r"synthDrivers\ibmtts") | ||
except: | ||
log.warning("error backing data", exc_info=True) | ||
if msg != "": | ||
gui.messageBox(msg, | ||
|
||
if not os.path.exists(os.path.join(os.path.dirname(__file__), 'synthDrivers', TTSPath, dllName)): | ||
# Translators: the message shown if the driver can't find libraries during installation. | ||
msg = _("""The synthesizer won't be available until you set IBMTTS files. NVDA won't show this synthesizer in teh synthesizers lists because you need to set the IBMTTS files location first. | ||
To do it open the NVDA settings dialog, select IBMTTS category and use the "Browse for IBMTTS library" button to select the IBMTTS files folder.\n""") | ||
gui.messageBox( | ||
msg, | ||
# Translators: title of message box when user is installing NVDA | ||
_("IBMTTS driver for NVDA"), wx.OK) | ||
_("IBMTTS driver for NVDA"), wx.OK | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters