~vorlon/ddeb-retriever/python3

« back to all changes in this revision

Viewing changes to archive_tools.py

  • Committer: Steve Langasek
  • Date: 2017-05-23 23:44:41 UTC
  • Revision ID: steve.langasek@canonical.com-20170523234441-0q4ctgb00kyc5jt4
better python3ing of hash sorting

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
        if cmp(max.get(parser.section[group_by], ('', ''))[0], parser.section[sort_key]) < 0:
158
158
            max[parser.section[group_by]] = (parser.section[sort_key], str(parser.section))
159
159
 
160
 
    ks = list(max.keys())
161
 
    ks.sort()
 
160
    ks = sorted(max)
162
161
    first = True
163
162
    for k in ks:
164
163
        if first:
716
715
    '''Return string with space-separated sorted list of keys of a
717
716
    dictionary.'''
718
717
 
719
 
    k = list(map.keys())
720
 
    k.sort()
 
718
    k = sorted(map)
721
719
    return ' '.join(k)
722
720
 
723
721