mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 06:29:18 +02:00
See #170: fetching remote objects
This commit is contained in:
parent
65097f6297
commit
c2eeee5eb1
30 changed files with 1173 additions and 169 deletions
|
@ -9,21 +9,17 @@ def print_duplicates(path):
|
|||
contexts_by_id = collections.defaultdict(list)
|
||||
for e in pofile:
|
||||
contexts_by_id[e.msgid].append(e.msgctxt)
|
||||
count = collections.Counter(
|
||||
[e.msgid for e in pofile]
|
||||
)
|
||||
duplicates = [
|
||||
(k, v) for k, v in count.items()
|
||||
if v > 1
|
||||
]
|
||||
count = collections.Counter([e.msgid for e in pofile])
|
||||
duplicates = [(k, v) for k, v in count.items() if v > 1]
|
||||
for k, v in sorted(duplicates, key=lambda r: r[1], reverse=True):
|
||||
print('{} entries - {}:'.format(v, k))
|
||||
print("{} entries - {}:".format(v, k))
|
||||
for ctx in contexts_by_id[k]:
|
||||
print(' - {}'.format(ctx))
|
||||
print(" - {}".format(ctx))
|
||||
print()
|
||||
|
||||
total_duplicates = sum([v - 1 for _, v in duplicates])
|
||||
print('{} total duplicates'.format(total_duplicates))
|
||||
print("{} total duplicates".format(total_duplicates))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue