Lizenzinfo als Ausgabe
This commit is contained in:
parent
c9659d90a0
commit
796d5acbe0
|
@ -44,6 +44,8 @@ with open("rechte.json", "r") as rechte_file:
|
||||||
tiledfile = sys.argv[1]
|
tiledfile = sys.argv[1]
|
||||||
print("Überschreibe jetzt die Datei mit geändertem Inhalt: " + tiledfile)
|
print("Überschreibe jetzt die Datei mit geändertem Inhalt: " + tiledfile)
|
||||||
mapjson = []
|
mapjson = []
|
||||||
|
lizenzen_fehlend = 0
|
||||||
|
lizenzen_vorh = 0
|
||||||
with open(tiledfile, "r") as map_file:
|
with open(tiledfile, "r") as map_file:
|
||||||
mapjson = json.load(map_file)
|
mapjson = json.load(map_file)
|
||||||
try:
|
try:
|
||||||
|
@ -53,10 +55,12 @@ with open("rechte.json", "r") as rechte_file:
|
||||||
image = ts["image"]
|
image = ts["image"]
|
||||||
lizTxt = img2liz(image, rechte)
|
lizTxt = img2liz(image, rechte)
|
||||||
if lizTxt:
|
if lizTxt:
|
||||||
print("--> verwende Lizenz " + lizTxt)
|
print(" --> verwende Lizenz " + lizTxt)
|
||||||
addLiz(ts, lizTxt)
|
addLiz(ts, lizTxt)
|
||||||
|
lizenzen_vorh += 1
|
||||||
else:
|
else:
|
||||||
print("--> keine Lizenz zu " + image + " gefunden")
|
print("x --> keine Lizenz zu " + image + " gefunden")
|
||||||
|
lizenzen_fehlend += 1
|
||||||
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
|
@ -67,5 +71,7 @@ with open("rechte.json", "r") as rechte_file:
|
||||||
with open(tiledfile, "w") as map_out_file:
|
with open(tiledfile, "w") as map_out_file:
|
||||||
json.dump(mapjson, map_out_file, indent=4)
|
json.dump(mapjson, map_out_file, indent=4)
|
||||||
print("geschrieben")
|
print("geschrieben")
|
||||||
|
print(f"{lizenzen_vorh} / {lizenzen_fehlend + lizenzen_vorh} Tilesets eingetragen.")
|
||||||
|
print(f"{lizenzen_fehlend} Lizenzangaben fehlen.")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue