Grammalecte  Check-in [771500b70e]

Overview
Comment:[build][tb] new file name for Thunderbird extension
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | build | tb
Files: files | file ages | folders
SHA3-256: 771500b70ed8959ec86613d943b3eb9cb65aceaf0927514c48eaebfafd0c01cd
User & Date: olr on 2020-08-18 13:35:15
Other Links: manifest | tags
Context
2020-08-18
13:49
[fr] mise à jour du dictionnaire check-in: 2a2e05420f user: olr tags: trunk, fr, v1.12.0
13:35
[build][tb] new file name for Thunderbird extension check-in: 771500b70e user: olr tags: trunk, build, tb
12:14
[fr] ajustements check-in: 6e60cdd425 user: olr tags: trunk, fr
Changes

Modified gc_lang/fr/build.py from [7610b8d379] to [fab4b52b52].

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
        sHTML += '</div>\n'
    return sHTML


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, sLang)
    for spf in ["LICENSE.txt", "LICENSE.fr.txt"]:
        hZip.write(spf)
    helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/mailext", "", dVars, True)
    helpers.addFileToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/background.js", "background.js", dVars)
    helpers.addFileToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/gce_worker.js", "gce_worker.js", dVars)
    helpers.addFileToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/README.md", "README.md", dVars)
    helpers.addFileToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/NOTE_FOR_REVIEWERS.md", "NOTE_FOR_REVIEWERS.md", dVars)
    helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/3rd", "3rd", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/_locales", "_locales", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/content_scripts", "content_scripts", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/fonts", "fonts", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/img", "img", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, "gc_lang/"+sLang+"/webext/panel", "panel", dVars, True)
    hZip.close()
    # Note about copying Thunderbird extension directly into the profile:
    # In Options > Configuration editor (about:config), deactivate option <xpinstall.whitelist.required>
    # If <manifest.json> is changed, you must reinstall the extension manually
    spExtension = dVars['win_tb_debug_extension_path']  if platform.system() == "Windows"  else dVars['linux_tb_debug_extension_path']
    if os.path.isdir(spExtension):
        file_util.copy_file(spfZip, f"{spExtension}/{dVars['tb_identifier']}.xpi")  # Filename for TB is just <identifier.xpi>







|




|
|
|
|
|
|
|
|
|
|
|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
        sHTML += '</div>\n'
    return sHTML


def createMailExtension (sLang, dVars):
    "create extension for Thunderbird (as MailExtension)"
    print("> Building extension for Thunderbird (MailExtension)")
    spfZip = f"_build/thunderbird-grammalecte-{sLang}-v{dVars['version']}.mailext.xpi"
    hZip = zipfile.ZipFile(spfZip, mode='w', compression=zipfile.ZIP_DEFLATED)
    _copyGrammalecteJSPackageInZipFile(hZip, sLang)
    for spf in ["LICENSE.txt", "LICENSE.fr.txt"]:
        hZip.write(spf)
    helpers.addFolderToZipAndFileFile(hZip, f"gc_lang/{sLang}/mailext", "", dVars, True)
    helpers.addFileToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/background.js", "background.js", dVars)
    helpers.addFileToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/gce_worker.js", "gce_worker.js", dVars)
    helpers.addFileToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/README.md", "README.md", dVars)
    helpers.addFileToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/NOTE_FOR_REVIEWERS.md", "NOTE_FOR_REVIEWERS.md", dVars)
    helpers.addFolderToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/3rd", "3rd", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/_locales", "_locales", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/content_scripts", "content_scripts", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/fonts", "fonts", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/img", "img", dVars, True)
    helpers.addFolderToZipAndFileFile(hZip, f"gc_lang/{sLang}/webext/panel", "panel", dVars, True)
    hZip.close()
    # Note about copying Thunderbird extension directly into the profile:
    # In Options > Configuration editor (about:config), deactivate option <xpinstall.whitelist.required>
    # If <manifest.json> is changed, you must reinstall the extension manually
    spExtension = dVars['win_tb_debug_extension_path']  if platform.system() == "Windows"  else dVars['linux_tb_debug_extension_path']
    if os.path.isdir(spExtension):
        file_util.copy_file(spfZip, f"{spExtension}/{dVars['tb_identifier']}.xpi")  # Filename for TB is just <identifier.xpi>