~rbalint/ubuntu-archive-tools/conffiles-diff

« back to all changes in this revision

Viewing changes to nbs-report

  • Committer: Iain Lane
  • Date: 2020-11-06 11:53:32 UTC
  • Revision ID: iain.lane@canonical.com-20201106115332-zdnibitzb4rwgst4
nbs-report: Use functools.cmp_to_key to transition from old-style cmp= to python3's key= param to sorted()

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from collections import defaultdict
23
23
import csv
 
24
import functools
24
25
from optparse import OptionParser
25
26
import os
26
27
import sys
236
237
        else:
237
238
            return -len_cmp
238
239
 
239
 
    for pkg in sorted(reverse_nbs, cmp=sort_rev_nbs):
 
240
    for pkg in sorted(reverse_nbs, key=functools.cmp_to_key(sort_rev_nbs)):
240
241
        print('<tr><td>%s</td> '
241
242
              '<td><span class="component%s">%s</span></td><td>' % (
242
243
                  pkg, pkg_component[pkg][1], pkg_component[pkg][0]), end="")