From: Mark Wooding Date: Sat, 2 May 2015 16:05:20 +0000 (+0100) Subject: peerdb/tripe-newpeers.in: Sort the output so that testing is easier. X-Git-Tag: 1.0.0pre17~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/commitdiff_plain/527cd49ffd468167e244dea6751698944be6896d peerdb/tripe-newpeers.in: Sort the output so that testing is easier. --- diff --git a/peerdb/tripe-newpeers.in b/peerdb/tripe-newpeers.in index aa9ccfcb..d22aff7f 100644 --- a/peerdb/tripe-newpeers.in +++ b/peerdb/tripe-newpeers.in @@ -303,7 +303,7 @@ def output(conf, cdb): This is where the special `user' and `auto' database entries get set. """ auto = [] - for sec in conf.sections(): + for sec in sorted(conf.sections()): if sec.startswith('@'): continue elif sec.startswith('$'): @@ -316,7 +316,7 @@ def output(conf, cdb): if conf.has_option(sec, 'user'): cdb.add('U%s' % conf.get(sec, 'user'), sec) url = M.URLEncode(laxp = True, semip = True) - for key, value in conf.items(sec): + for key, value in sorted(conf.items(sec), key = lambda (k, v): k): if not key.startswith('@'): url.encode(key, ' '.join(M.split(value)[0])) cdb.add(label, url.result)