Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
[PATCH] Add --sort=score option to reflector
--- Reflector.py.orig 2012-03-23 17:33:39.317842672 -0500
+++ Reflector.py 2012-03-23 17:52:41.385672960 -0500
@@ -34,7 +34,8 @@
# Recognized list sort types and their descriptions.
SORT_TYPES = {'age': 'last server synchronization',
'rate': 'download rate',
- 'country': 'server\'s location'}
+ 'country': 'server\'s location',
+ 'score': 'MirrorStatus score'}
# Known repositories, i.e. those that should be on each mirror.
# Used to replace the "$repo" variable.
REPOSITORIES = [
@@ -159,6 +160,8 @@
mirrors = self.rate(mirrors)
elif by == 'country':
mirrors.sort(key=lambda m: m['country'])
+ if by == 'score':
+ mirrors.sort(key=lambda m: m['score'])
return mirrors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.