Grammalecte  Diff

Differences From Artifact [d49776adfe]:

To Artifact [fcaba47e9b]:


1
2
3

4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
11



+







# Builder for French language

import os
import subprocess
import platform
import zipfile
from distutils import dir_util, file_util

import helpers


87
88
89
90
91
92
93

94
95
96











88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109







+



+
+
+
+
+
+
+
+
+
+
+
            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)


def createNodeJSPackage (sLang):
    print("Building for NodeJS")
    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")
    corePack = ""
    cliPack = ""
    with helpers.cd("_build/nodejs/"+sLang):
        corePack = subprocess.check_output("npm pack ./core", shell=True)
    with helpers.cd("_build/nodejs/"+sLang+"/cli"):
        subprocess.check_output("npm --no-save install ../"+corePack.decode("utf-8").split('\n', 1)[0], shell=True)
    with helpers.cd("_build/nodejs/"+sLang):
        cliPack = subprocess.check_output("npm pack ./cli", shell=True)
    print("Fichiers à distribuer:")
    print(" pour le dev: "+corePack.decode("utf-8").split('\n', 1)[0])
    print(" pour une installation du client: "+cliPack.decode("utf-8").split('\n', 1)[0])