Skip to content

Commit a854617

Browse files
committed
Fix make to avoid making duplicated lines in listings
when another addon has been added above it in listing.
1 parent 541c448 commit a854617

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

make.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -509,23 +509,23 @@ def register(ptype, **kwargs):
509509
fp_out = open(r("../addons/%(gramps_version)s/listings/") +("addons-%s.new" % lang), "w", encoding="utf-8")
510510
added = False
511511
for line in fp_in:
512-
if line in already_added:
513-
continue
514512
dictionary = eval(line)
513+
if ("""{"t":'%(t)s',"i":'%(i)s',"n":'%(n)s'}""" % dictionary) in already_added:
514+
continue
515515
if cmd_arg + ".addon.tgz" in line and plugin["t"] == dictionary["t"] and not added:
516516
#print("UPDATED")
517517
print("""{"t":'%(t)s',"i":'%(i)s',"n":'%(n)s',"v":'%(v)s',"g":'%(g)s',"d":'%(d)s',"z":'%(z)s'}""" % plugin, file=fp_out)
518518
added = True
519-
already_added.append("""{"t":'%(t)s',"i":'%(i)s',"n":'%(n)s',"v":'%(v)s',"g":'%(g)s',"d":'%(d)s',"z":'%(z)s'}""" % plugin)
519+
already_added.append("""{"t":'%(t)s',"i":'%(i)s',"n":'%(n)s'}""" % plugin)
520520
elif ((plugin["t"], plugin["i"]) < (dictionary["t"], dictionary["i"])) and not added:
521521
#print("ADDED in middle")
522522
print("""{"t":'%(t)s',"i":'%(i)s',"n":'%(n)s',"v":'%(v)s',"g":'%(g)s',"d":'%(d)s',"z":'%(z)s'}""" % plugin, file=fp_out)
523523
added = True
524524
print(line, end="", file=fp_out)
525-
already_added.append("""{"t":'%(t)s',"i":'%(i)s',"n":'%(n)s',"v":'%(v)s',"g":'%(g)s',"d":'%(d)s',"z":'%(z)s'}""" % plugin)
525+
already_added.append("""{"t":'%(t)s',"i":'%(i)s',"n":'%(n)s'}""" % plugin)
526526
else:
527527
print(line, end="", file=fp_out)
528-
already_added.append(line)
528+
already_added.append("""{"t":'%(t)s',"i":'%(i)s',"n":'%(n)s'}""" % dictionary)
529529
if not added:
530530
if ("""{"t":'%(t)s',"i":'%(i)s',"n":'%(n)s',"v":'%(v)s',"g":'%(g)s',"d":'%(d)s',"z":'%(z)s'}""" % plugin) not in already_added:
531531
#print("ADDED at end")

0 commit comments

Comments
 (0)