Index: gc_lang/fr/build.py
==================================================================
--- gc_lang/fr/build.py
+++ gc_lang/fr/build.py
@@ -10,10 +10,11 @@
def build (sLang, dVars, spLangPack):
"complementary build launched from make.py"
createWebExtension(sLang, dVars)
createThunderbirdExtension(sLang, dVars, spLangPack)
+ createMailExtension(sLang, dVars, spLangPack)
createNodeJSPackage(sLang)
def createWebExtension (sLang, dVars):
"create Web-extension"
@@ -37,28 +38,39 @@
for sOpt in lLineOpt:
sHTML += f'
\n'
sHTML += '\n'
return sHTML
+
+def createMailExtension (sLang, dVars, spLangPack):
+ "create extension for Thunderbird (as MailExtension)"
+ print("Building extension for Thunderbird (MailExtension)")
+ spfZip = "_build/" + dVars['tb_identifier'] + "-v" + dVars['version'] + '.mailext.xpi'
+ hZip = zipfile.ZipFile(spfZip, mode='w', compression=zipfile.ZIP_DEFLATED)
+ _copyGrammalecteJSPackageInZipFile(hZip, spLangPack)
+ for spf in ["LICENSE.txt", "LICENSE.fr.txt"]:
+ hZip.write(spf)
+ dVars = _createOptionsForThunderbird(dVars)
+ helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/mailext", "", dVars, True)
+ hZip.close()
+ spBetaExtension = dVars['win_tb_beta_extension_filepath'] if platform.system() == "Windows" else dVars['linux_tb_beta_extension_filepath']
+ file_util.copy_file(spfZip, spBetaExtension + "/" + dVars['tb_identifier']+ ".xpi") # Filename for TB is just
+
def createThunderbirdExtension (sLang, dVars, spLangPack):
- "create extension for Thunderbird"
+ "create extension for Thunderbird (as XUL addon)"
print("Building extension for Thunderbird")
- sExtensionName = dVars['tb_identifier'] + "-v" + dVars['version'] + '.xpi'
- spfZip = "_build/" + sExtensionName
+ spfZip = "_build/" + dVars['tb_identifier'] + "-v" + dVars['version'] + '.xpi'
hZip = zipfile.ZipFile(spfZip, mode='w', compression=zipfile.ZIP_DEFLATED)
_copyGrammalecteJSPackageInZipFile(hZip, spLangPack)
for spf in ["LICENSE.txt", "LICENSE.fr.txt"]:
hZip.write(spf)
dVars = _createOptionsForThunderbird(dVars)
helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/tb", "", dVars, True)
hZip.close()
spDebugProfile = dVars['win_tb_debug_extension_path'] if platform.system() == "Windows" else dVars['linux_tb_debug_extension_path']
helpers.unzip(spfZip, spDebugProfile)
- spfBetaExtension = dVars['win_tb_beta_extension_filepath'] if platform.system() == "Windows" else dVars['linux_tb_beta_extension_filepath']
- #helpers.unzip(spfZip, spBetaProfile)
- file_util.copy_file(spfZip, spfBetaExtension)
def _createOptionsForThunderbird (dVars):
dVars['sXULTabs'] = ""
dVars['sXULTabPanels'] = ""
Index: gc_lang/fr/config.ini
==================================================================
--- gc_lang/fr/config.ini
+++ gc_lang/fr/config.ini
@@ -8,11 +8,11 @@
# always use 3 numbers for version: x.y.z
version = 1.1.1
author = Olivier R.
provider = Grammalecte.net
link = https://grammalecte.net
-description = Correcteur grammatical pour le français.
+description = Correcteur grammatical, orthographique et typographique pour le français.
extras = README_fr.txt
logo = logo.png
# main dictionary
lexicon_src = lexicons/French.lex
@@ -59,12 +59,12 @@
win_tb_beta_path = C:\Program Files\Thunderbird Daily\thunderbird.exe
linux_tb_path = /usr/bin/thunderbird
linux_tb_beta_path = /usr/bin/thunderbird
win_tb_debug_extension_path = D:\_temp\tb-debug.profile\extensions\French-GC-TB@grammalecte.net
linux_tb_debug_extension_path = ~/tb-debug.profile/extensions/French-GC-TB@grammalecte.net
-win_tb_beta_extension_filepath = D:\_temp\tb-beta.profile\extensions\French-GC-TB@grammalecte.net.xpi
-linux_tb_beta_extension_filepath = ~/tb-beta.profile/extensions/French-GC-TB@grammalecte.net.xpi
+win_tb_beta_extension_filepath = D:\_temp\tb-beta.profile\extensions
+linux_tb_beta_extension_filepath = ~/tb-beta.profile/extensions
# Set Thunderbird folder in your PATH variable
# Create a local profile:
# thunderbird -CreateProfile "debug _build\tb-debug.profile"
# Or you can use the GUI with:
# thunderbird -P
Index: helpers.py
==================================================================
--- helpers.py
+++ helpers.py
@@ -34,11 +34,11 @@
if os.path.isdir(spInstall):
eraseFolder(spInstall)
with zipfile.ZipFile(spfZip) as hZip:
hZip.extractall(spDest)
else:
- print("# folder not found")
+ print("# folder <" + spDest + "> not found")
else:
print("path destination is empty")
def eraseFolder (sp):
@@ -94,9 +94,9 @@
spfDst = (spDst + "/" + sf).strip("/ ")
if os.path.isdir(spfSrc):
if bRecursive:
addFolderToZipAndFileFile(hZip, spfSrc, spfDst, dVars, bRecursive)
else:
- if spfSrc.endswith((".py", ".js", ".css", ".xcu", ".xul", ".rdf", ".dtd", ".properties")):
+ if spfSrc.endswith((".py", ".js", ".json", ".css", ".xcu", ".xul", ".rdf", ".dtd", ".properties")):
hZip.writestr(spfDst, fileFile(spfSrc, dVars))
else:
hZip.write(spfSrc, spfDst)