forked from External/ergo
refactor atheme2json to sort channel modes
This makes invoking the script multiple times with the same input return the same result, which may not be the case before because sets are unordered and thus the channel modes can become reordered across multiple invocations of the script.
This commit is contained in:
parent
c4b7b8af3a
commit
7e5cdc4f90
1 changed files with 1 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ def convert(infile):
|
||||||
modes.add(mode)
|
modes.add(mode)
|
||||||
elif flag & mlock_off != 0 and mode in modes:
|
elif flag & mlock_off != 0 and mode in modes:
|
||||||
modes.remove(mode)
|
modes.remove(mode)
|
||||||
chdata['modes'] = ''.join(modes)
|
chdata['modes'] = ''.join(sorted(modes))
|
||||||
chdata['limit'] = int(parts[7])
|
chdata['limit'] = int(parts[7])
|
||||||
elif category == 'MDC':
|
elif category == 'MDC':
|
||||||
# auxiliary data for a channel registration
|
# auxiliary data for a channel registration
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue