removing potential duplicates

master
Steve L. Nyemba 8 years ago
parent b9dda8fd47
commit 00c19c2dd7

@ -254,12 +254,18 @@ def get_folders():
if 'folders' in d: if 'folders' in d:
d = d['folders'] d = d['folders']
r = [] r = []
m = {}
for row in d : for row in d :
keys = row.keys()[0] key = row.keys()[0]
row = row[keys] row = row[key]
if key not in m:
r.append(row) r.append(row)
m[key] = len(r) -1
else:
index = m[key]
r[index] = row
d = r d = r
else: else:
d = [] d = []

Loading…
Cancel
Save