Index: gc_lang/fr/build.py ================================================================== --- gc_lang/fr/build.py +++ gc_lang/fr/build.py @@ -25,10 +25,12 @@ dVars['webextOptionsHTML'] = _createOptionsForWebExtension(dVars) helpers.copyAndFileTemplate("_build/webext/"+sLang+"/manifest.json", "_build/webext/"+sLang+"/manifest.json", dVars) helpers.copyAndFileTemplate("_build/webext/"+sLang+"/panel/main.html", "_build/webext/"+sLang+"/panel/main.html", dVars) with helpers.CD("_build/webext/"+sLang): os.system("web-ext build") + # Copy Firefox zip extension to _build + helpers.moveFolderContent("_build/webext/"+sLang+"/web-ext-artifacts", "_build", "fx-"+sLang+"-", True) def _createOptionsForWebExtension (dVars): sHTML = "" sLang = dVars['sDefaultUILang'] Index: helpers.py ================================================================== --- helpers.py +++ helpers.py @@ -70,10 +70,24 @@ if e.errno == errno.ENOTDIR: shutil.copy(spSrc, spDst) else: raise + +def moveFolderContent (spSrc, spDst, sPrefix="", bLog=False): + "move folder content from to : if files already exist in , they are replaced. (not recursive)" + try: + for sf in os.listdir(spSrc): + spfSrc = os.path.join(spSrc, sf) + if os.path.isfile(spfSrc): + spfDst = os.path.join(spDst, sPrefix + sf) + shutil.move(spfSrc, spfDst) + if bLog: + print("file <" + spfSrc + "> moved to <"+spfDst+">") + except: + raise + def fileFile (spf, dVars): "return file as a text filed with variables from " return Template(open(spf, "r", encoding="utf-8").read()).safe_substitute(dVars)