From 4d75b63c95078b4dfbe38a97ae25937c427b5fe6 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Tue, 2 Jul 2013 17:24:33 +0800 Subject: [PATCH] sort as the sort command does --- README.rst | 4 ++++ nvchecker | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 8e4747b..df3eb41 100644 --- a/README.rst +++ b/README.rst @@ -86,3 +86,7 @@ Other ----- More to come. Send me a patch or pull request if you can't wait and have written one yourself :-) +Bugs +---- +* Finish writing results even on Ctrl-C or other interruption. +* ``setup.py`` script. diff --git a/nvchecker b/nvchecker index a82e10d..563f8c5 100755 --- a/nvchecker +++ b/nvchecker @@ -62,7 +62,9 @@ def write_verfile(): return with open(options.verfile, 'w') as f: - for item in sorted(g_curver.items()): + # sort using only alphanums, as done by the sort command, and needed by + # comm command + for item in sorted(g_curver.items(), key=lambda i: (''.join(filter(str.isalnum, i[0])), i[1])): print('%s: %s' % item, file=f) def print_version_update(name, version):