From 9b41ebdc97bff9f168611c6829753200df6a5c18 Mon Sep 17 00:00:00 2001 From: Pavel Brychta Date: Fri, 3 Jul 2020 09:03:33 +0200 Subject: [PATCH] Moznost vynechat 'data' adresar --- generate.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/generate.py b/generate.py index f1b5172..045394a 100644 --- a/generate.py +++ b/generate.py @@ -204,6 +204,7 @@ def getgitversion(): if __name__ == "__main__": version = getgitversion() + datadir = None templatevars['version'] = version print("Web version " + version) with open(PROJECT_FILE) as fd: @@ -214,13 +215,15 @@ if __name__ == "__main__": approotdir = build["approotdir"] outputdir = build["outputdir"] - datadir = build["datadir"] + if "datadir" in build: + datadir = build["datadir"] if "flist" in build: flist = build["flist"] # Vycistime vystupni adresare cleanup(outputdir) - cleanup(datadir) + if datadir is not None: + cleanup(datadir) # Zacneme kombinaci soubou if "combine" in build: @@ -236,13 +239,14 @@ if __name__ == "__main__": copyfiles(copy, approotdir, outputdir) # .. a koncime prekopirovanim souboru do vystupniho adresare s prubeznou kompresi pozadovanych souboru a vytvareni flist.txt - deploy = [] - if flist is not None: - flistcontent = ":" + version + "\r\n" - if "copy" in build: - deploy = build["copy"] - copycompresstree(outputdir, datadir, deploy, datadir) - if flist is not None: - with open(os.path.normpath(os.path.join(datadir, flist)), 'wb') as outfile: - outfile.write(flistcontent.encode('utf-8')) - outfile.close() + if datadir is not None: + deploy = [] + if flist is not None: + flistcontent = ":" + version + "\r\n" + if "copy" in build: + deploy = build["copy"] + copycompresstree(outputdir, datadir, deploy, datadir) + if flist is not None: + with open(os.path.normpath(os.path.join(datadir, flist)), 'wb') as outfile: + outfile.write(flistcontent.encode('ascii', 'ignore')) + outfile.close()