142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
with open("server_options."+sLang+".ini", "w", encoding="utf-8", newline="\n") as hDst:
hDst.write("# Server options. Lang: " + sLang + "\n\n[gc_options]\n")
for sSection, lOpt in dOptData["lStructOpt"]:
hDst.write("\n########## " + dOptData["dOptLabel"][sLang].get(sSection, sSection + "[no label found]")[0] + " ##########\n")
for lLineOpt in lOpt:
for sOpt in lLineOpt:
hDst.write("# " + dOptData["dOptLabel"][sLang].get(sOpt, "[no label found]")[0] + "\n")
hDst.write(sOpt + " = " + ("1" if dOptData["dOptPython"].get(sOpt, None) else "0") + "\n")
hDst.write("html = 1\n")
def createServerZip (sLang, dVars, spLangPack):
"create server zip"
spfZip = "_build/" + dVars['name'] + "-"+ dVars['lang'] +"-v" + dVars['version'] + '.zip'
hZip = zipfile.ZipFile(spfZip, mode='w', compression=zipfile.ZIP_DEFLATED)
|
|
|
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
with open("server_options."+sLang+".ini", "w", encoding="utf-8", newline="\n") as hDst:
hDst.write("# Server options. Lang: " + sLang + "\n\n[gc_options]\n")
for sSection, lOpt in dOptData["lStructOpt"]:
hDst.write("\n########## " + dOptData["dOptLabel"][sLang].get(sSection, sSection + "[no label found]")[0] + " ##########\n")
for lLineOpt in lOpt:
for sOpt in lLineOpt:
hDst.write("# " + dOptData["dOptLabel"][sLang].get(sOpt, "[no label found]")[0] + "\n")
hDst.write(sOpt + " = " + ("1" if dOptData["dOptServer"].get(sOpt, None) else "0") + "\n")
hDst.write("html = 1\n")
def createServerZip (sLang, dVars, spLangPack):
"create server zip"
spfZip = "_build/" + dVars['name'] + "-"+ dVars['lang'] +"-v" + dVars['version'] + '.zip'
hZip = zipfile.ZipFile(spfZip, mode='w', compression=zipfile.ZIP_DEFLATED)
|
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
sCodePlugins += "\n\n" + open(spLang+'/modules-js/'+sf, "r", encoding="utf-8").read()
print(sf, end=", ")
print()
dVars["pluginsJS"] = sCodePlugins
# options data struct
dVars["dOptJavaScript"] = json.dumps(list(dVars["dOptJavaScript"].items()))
# create folder
spLangPack = "grammalecte-js/"+sLang
helpers.createCleanFolder(spLangPack)
# create files
for sf in os.listdir("gc_core/js"):
|
>
>
|
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
|
sCodePlugins += "\n\n" + open(spLang+'/modules-js/'+sf, "r", encoding="utf-8").read()
print(sf, end=", ")
print()
dVars["pluginsJS"] = sCodePlugins
# options data struct
dVars["dOptJavaScript"] = json.dumps(list(dVars["dOptJavaScript"].items()))
dVars["dOptFirefox"] = json.dumps(list(dVars["dOptFirefox"].items()))
dVars["dOptThunderbird"] = json.dumps(list(dVars["dOptThunderbird"].items()))
# create folder
spLangPack = "grammalecte-js/"+sLang
helpers.createCleanFolder(spLangPack)
# create files
for sf in os.listdir("gc_core/js"):
|