Index: gc_lang/fr/build.py ================================================================== --- gc_lang/fr/build.py +++ gc_lang/fr/build.py @@ -6,15 +6,15 @@ from distutils import dir_util, file_util import helpers -def build (sLang, dVars, spLangPack): +def build (sLang, dVars): "complementary build launched from make.py" createWebExtension(sLang, dVars) - createThunderbirdExtension(sLang, dVars, spLangPack) - createMailExtension(sLang, dVars, spLangPack) + createThunderbirdExtension(sLang, dVars) + createMailExtension(sLang, dVars) createNodeJSPackage(sLang) def createWebExtension (sLang, dVars): "create Web-extension" @@ -39,38 +39,40 @@ sHTML += f'

\n' sHTML += '\n' return sHTML -def createMailExtension (sLang, dVars, spLangPack): +def createMailExtension (sLang, dVars): "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) + _copyGrammalecteJSPackageInZipFile(hZip, sLang) 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 + spExtension = dVars['win_tb_debug_extension_path'] if platform.system() == "Windows" else dVars['linux_tb_debug_extension_path'] + file_util.copy_file(spfZip, spExtension + "/" + dVars['tb_identifier']+ ".xpi") # Filename for TB is just + spExtension = dVars['win_tb_beta_extension_path'] if platform.system() == "Windows" else dVars['linux_tb_beta_extension_path'] + file_util.copy_file(spfZip, spExtension + "/" + dVars['tb_identifier']+ ".xpi") # Filename for TB is just -def createThunderbirdExtension (sLang, dVars, spLangPack): +def createThunderbirdExtension (sLang, dVars): "create extension for Thunderbird (as XUL addon)" print("Building extension for Thunderbird") spfZip = "_build/" + dVars['tb_identifier'] + "-v" + dVars['version'] + '.xpi' hZip = zipfile.ZipFile(spfZip, mode='w', compression=zipfile.ZIP_DEFLATED) - _copyGrammalecteJSPackageInZipFile(hZip, spLangPack) + _copyGrammalecteJSPackageInZipFile(hZip, sLang) 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) + #spDebugProfile = dVars['win_tb_debug_extension_path'] if platform.system() == "Windows" else dVars['linux_tb_debug_extension_path'] + #helpers.unzip(spfZip, spDebugProfile) def _createOptionsForThunderbird (dVars): dVars['sXULTabs'] = "" dVars['sXULTabPanels'] = "" @@ -86,24 +88,24 @@ for sLang in dVars['dOptLabel'].keys(): dVars['gc_options_labels_'+sLang] = "\n".join( [ "' for sOpt in dVars['dOptLabel'][sLang] ] ) return dVars -def _copyGrammalecteJSPackageInZipFile (hZip, spLangPack, sAddPath=""): +def _copyGrammalecteJSPackageInZipFile (hZip, sLang, sAddPath=""): for sf in os.listdir("grammalecte-js"): if not os.path.isdir("grammalecte-js/"+sf): - hZip.write("grammalecte-js/"+sf, sAddPath+"grammalecte-js/"+sf) + hZip.write("grammalecte-js/"+sf, sAddPath+"grammalecte/"+sf) for sf in os.listdir("grammalecte-js/graphspell"): if not os.path.isdir("grammalecte-js/graphspell/"+sf): - hZip.write("grammalecte-js/graphspell/"+sf, sAddPath+"grammalecte-js/graphspell/"+sf) + hZip.write("grammalecte-js/graphspell/"+sf, sAddPath+"grammalecte/graphspell/"+sf) for sf in os.listdir("grammalecte-js/graphspell/_dictionaries"): if not os.path.isdir("grammalecte-js/graphspell/_dictionaries/"+sf): - hZip.write("grammalecte-js/graphspell/_dictionaries/"+sf, sAddPath+"grammalecte-js/graphspell/_dictionaries/"+sf) - for sf in os.listdir(spLangPack): - if not os.path.isdir(spLangPack+"/"+sf): - hZip.write(spLangPack+"/"+sf, sAddPath+spLangPack+"/"+sf) + hZip.write("grammalecte-js/graphspell/_dictionaries/"+sf, sAddPath+"grammalecte/graphspell/_dictionaries/"+sf) + for sf in os.listdir("grammalecte-js/"+sLang): + if not os.path.isdir("grammalecte-js/"+sLang+"/"+sf): + hZip.write("grammalecte-js/"+sLang+"/"+sf, sAddPath+"grammalecte/"+sLang+"/"+sf) def createNodeJSPackage (sLang): helpers.createCleanFolder("_build/nodejs/"+sLang) dir_util.copy_tree("gc_lang/"+sLang+"/nodejs/", "_build/nodejs/"+sLang) dir_util.copy_tree("grammalecte-js", "_build/nodejs/"+sLang+"/core/grammalecte") Index: gc_lang/fr/config.ini ================================================================== --- gc_lang/fr/config.ini +++ gc_lang/fr/config.ini @@ -57,14 +57,14 @@ tb_name = Grammalecte [fr] win_tb_path = C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe 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 -linux_tb_beta_extension_filepath = ~/tb-beta.profile/extensions +win_tb_debug_extension_path = D:\_temp\tb-debug.profile\extensions +linux_tb_debug_extension_path = ~/tb-debug.profile/extensions +win_tb_beta_extension_path = D:\_temp\tb-beta.profile\extensions +linux_tb_beta_extension_path = ~/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: make.py ================================================================== --- make.py +++ make.py @@ -285,11 +285,11 @@ try: buildjs = importlib.import_module("gc_lang."+sLang+".build") except ImportError: print("# No complementary builder in folder gc_lang/"+sLang) else: - buildjs.build(sLang, dVars, spLangPack) + buildjs.build(sLang, dVars) return dVars['version'] def copyGraphspellCore (bJavaScript=False):