Avoid double insert

parent ea4948da
......@@ -38,11 +38,15 @@ def add_to_handymenu(user, cmd, category):
lastId = 0
found = False
found = alreadyIn = False
for app in yml:
lastId = max(app['id'], lastId)
if(app['name'] == category):
app['apps'] += [cmd]
for launcher in app['apps']:
if(launcher['Exec'] == cmd['Exec']):
alreadyIn = True
if(not alreadyIn):
app['apps'] += [cmd]
found = True
if(not found):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment