append to listorder

This commit is contained in:
j 2019-01-19 13:59:35 +05:30
parent 02c61c6350
commit 3a8429b9ac
1 changed files with 9 additions and 0 deletions

View File

@ -44,6 +44,11 @@ class Peer(object):
self.info['peers'] = {}
if 'lists' not in self.info:
self.info['lists'] = {}
for name in self.info['lists']:
if 'listorder' not in self.info:
self.info['listorder'] = []
if name not in self.info['listorder']:
self.info['listorder'].append(name)
def apply_log(self):
changes = []
@ -113,6 +118,10 @@ class Peer(object):
query = args[1]
if name not in self.info['lists']:
self.info['lists'][name] = []
if 'listorder' not in self.info:
self.info['listorder'] = []
if name not in self.info['listorder']:
self.info['listorder'].append(name)
elif action == 'editlist':
name, new = args
if name in self.info['lists']: