From 110c79ad0637c8e35b18c9ccc201d33d456d5453 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 16 Aug 2011 14:23:57 -0500 Subject: Small Python convention fixup Signed-off-by: Dan McGee --- mirrors/management/commands/mirrorcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mirrors') diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index 7bd79c83..8eb8b010 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -68,7 +68,7 @@ def check_mirror_url(mirror_url): log.last_sync = parsed_time # if we couldn't parse a time, this is a failure - if parsed_time == None: + if parsed_time is None: log.error = "Could not parse time from lastsync" log.is_success = False log.duration = end - start -- cgit v1.2.3-2-g168b From c5b370f432215eb69dabd6bcb911b6429b16447a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 22 Aug 2011 16:42:06 -0500 Subject: Admin setup tweaks Signed-off-by: Dan McGee --- mirrors/admin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mirrors') diff --git a/mirrors/admin.py b/mirrors/admin.py index b7b478de..0632872d 100644 --- a/mirrors/admin.py +++ b/mirrors/admin.py @@ -59,7 +59,8 @@ class MirrorAdminForm(forms.ModelForm): class MirrorAdmin(admin.ModelAdmin): form = MirrorAdminForm - list_display = ('name', 'tier', 'country', 'active', 'public', 'isos', 'admin_email', 'supported_protocols') + list_display = ('name', 'tier', 'country', 'active', 'public', + 'isos', 'admin_email') list_filter = ('tier', 'active', 'public', 'country') search_fields = ('name',) inlines = [ -- cgit v1.2.3-2-g168b From 71e57570c262fffb11ca6e0dc97342119198f740 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 11 Oct 2011 19:29:15 -0500 Subject: Pylint suggested and other cleanups Signed-off-by: Dan McGee --- mirrors/admin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mirrors') diff --git a/mirrors/admin.py b/mirrors/admin.py index 0632872d..3786d8d2 100644 --- a/mirrors/admin.py +++ b/mirrors/admin.py @@ -33,14 +33,15 @@ class MirrorUrlInlineAdmin(admin.TabularInline): extra = 3 # ripped off from django.forms.fields, adding netmask ability -ipv4nm_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}(/(\d|[1-2]\d|3[0-2])){0,1}$') +IPV4NM_RE = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}(/(\d|[1-2]\d|3[0-2])){0,1}$') + class IPAddressNetmaskField(forms.fields.RegexField): default_error_messages = { 'invalid': u'Enter a valid IPv4 address, possibly including netmask.', } def __init__(self, *args, **kwargs): - super(IPAddressNetmaskField, self).__init__(ipv4nm_re, *args, **kwargs) + super(IPAddressNetmaskField, self).__init__(IPV4NM_RE, *args, **kwargs) class MirrorRsyncForm(forms.ModelForm): class Meta: -- cgit v1.2.3-2-g168b From c692c96ff57272a2e59b7c2173dfb78cfa11f3ab Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 26 Oct 2011 19:18:26 -0500 Subject: Don't require mirrorlist URLs to have ISOs Signed-off-by: Dan McGee --- mirrors/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mirrors') diff --git a/mirrors/views.py b/mirrors/views.py index 6135cee3..417e26ee 100644 --- a/mirrors/views.py +++ b/mirrors/views.py @@ -57,7 +57,7 @@ def find_mirrors(request, countries=None, protocols=None, use_status=False, is_download=True).values_list('protocol', flat=True) qset = MirrorUrl.objects.select_related().filter( protocol__protocol__in=protocols, - mirror__public=True, mirror__active=True, mirror__isos=True + mirror__public=True, mirror__active=True, ) if countries and 'all' not in countries: qset = qset.filter(Q(country__in=countries) | -- cgit v1.2.3-2-g168b From d80f4236d01f70380f71a46dd98f1f789d91d31c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 10 Nov 2011 18:09:19 -0600 Subject: Add package signoffs JSON view This allows access to the same data (and even a bit more) from the signoffs overview page in a machine-friendly way. Signed-off-by: Dan McGee --- mirrors/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mirrors') diff --git a/mirrors/utils.py b/mirrors/utils.py index 686ec581..8518b3ba 100644 --- a/mirrors/utils.py +++ b/mirrors/utils.py @@ -40,7 +40,8 @@ def get_mirror_statuses(cutoff=default_cutoff): last_sync=Max('logs__last_sync'), last_check=Max('logs__check_time'), duration_avg=Avg('logs__duration'), - duration_stddev=StdDev('logs__duration') + #duration_stddev=StdDev('logs__duration') + duration_stddev=Max('logs__duration') ).order_by('-last_sync', '-duration_avg') # The Django ORM makes it really hard to get actual average delay in the -- cgit v1.2.3-2-g168b