Browse Source

Fix bug with the build

omassot 6 năm trước cách đây
mục cha
commit
b44af0361f
3 tập tin đã thay đổi với 23 bổ sung5 xóa
  1. 5 5
      build.py
  2. 0 0
      ext/__init__.py
  3. 18 0
      metadata.txt

+ 5 - 5
build.py

@@ -12,7 +12,7 @@ from path import Path
 build_dir = constants.MAIN / "build"
 version = constants.VERSION
 
-name = f"MnCheck_v{version}.zip"
+name = "MnCheck_v{}.zip".format(version.replace(".", "-"))
 
 config = configparser.ConfigParser()
 
@@ -32,7 +32,8 @@ config["general"] = {"name" : "MnCheck",
                     "experimental" : "False",
                     "deprecated" : "False"}
 
-with open(build_dir / 'metadata.txt', 'w+') as mdf:
+with open(constants.MAIN / 'metadata.txt', 'w+') as mdf:
+    mdf.write("# This file was generated by the build.py script, do not modify it direcly\n".upper())
     config.write(mdf)
 
 with ZipFile(build_dir / name, 'w') as zip_:
@@ -40,7 +41,7 @@ with ZipFile(build_dir / name, 'w') as zip_:
     def _zip_write(p):
         if p.ext == ".pyc":
             return
-        zip_.write(p, p.relpath(constants.MAIN))
+        zip_.write(p, "MnCheck\{}".format(p.relpath(constants.MAIN)))
     
     for f in Path(constants.MAIN / "ext").walkfiles():
         _zip_write(f)
@@ -56,7 +57,6 @@ with ZipFile(build_dir / name, 'w') as zip_:
     _zip_write(constants.MAIN / "README.md")
     _zip_write(constants.MAIN / "icon.png")
     _zip_write(constants.MAIN / "LICENSE")
-    
-    zip_.write(build_dir / "metadata.txt", "metadata.txt")
+    _zip_write(constants.MAIN / "metadata.txt")
     
 Path(build_dir / "metadata.txt").remove_p()

+ 0 - 0
ext/__init__.py


+ 18 - 0
metadata.txt

@@ -0,0 +1,18 @@
+# This file was generated by the build.py script, do not modify it direcly
+[general]
+name = MnCheck
+qgisminimumversion = 3.4
+description = Contrôle des données FTTH format MN
+version = 0.7.4
+author = Manche Numérique 2019
+email = sig@manchenumerique.fr
+about = Auto-contrôle des livrables FTTH aux formats Manche Numérique
+tracker = 
+repository = 
+tags = python
+homepage = http://www.manchenumerique.fr/
+category = Plugins
+icon = icon.png
+experimental = False
+deprecated = False
+