From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1544038-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E35CE15800A for <garchives@archives.gentoo.org>; Mon, 7 Aug 2023 00:14:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2F8A42BC025; Mon, 7 Aug 2023 00:14:24 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 12C752BC025 for <gentoo-commits@lists.gentoo.org>; Mon, 7 Aug 2023 00:14:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 20FCD340CD0 for <gentoo-commits@lists.gentoo.org>; Mon, 7 Aug 2023 00:14:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1AAD3F25 for <gentoo-commits@lists.gentoo.org>; Mon, 7 Aug 2023 00:14:20 +0000 (UTC) From: "Sam James" <sam@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org> Message-ID: <1691367148.816c1882de41dcf4a2fc65e455f95f8d8197883e.sam@gentoo> Subject: [gentoo-commits] proj/mirrorselect:master commit in: mirrorselect/ X-VCS-Repository: proj/mirrorselect X-VCS-Files: mirrorselect/mirrorparser3.py mirrorselect/selectors.py X-VCS-Directories: mirrorselect/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 816c1882de41dcf4a2fc65e455f95f8d8197883e X-VCS-Branch: master Date: Mon, 7 Aug 2023 00:14:20 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 419ea636-fa74-4cac-9eac-03f6aad2682f X-Archives-Hash: 691ef1b7abde078b48d96dc6f5ecfb97 commit: 816c1882de41dcf4a2fc65e455f95f8d8197883e Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Mon Aug 7 00:09:58 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Mon Aug 7 00:12:28 2023 +0000 URL: https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=816c1882 Run `autopep8` Signed-off-by: Sam James <sam <AT> gentoo.org> mirrorselect/mirrorparser3.py | 4 +++- mirrorselect/selectors.py | 17 ++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/mirrorselect/mirrorparser3.py b/mirrorselect/mirrorparser3.py index 37245ff..3e32880 100644 --- a/mirrorselect/mirrorparser3.py +++ b/mirrorselect/mirrorparser3.py @@ -86,7 +86,9 @@ class MirrorParser3: if __name__ == "__main__": import sys - import urllib.request, urllib.parse, urllib.error + import urllib.request + import urllib.parse + import urllib.error parser = MirrorParser3() parser.parse(urllib.request.urlopen(MIRRORS_3_XML).read()) diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py index 4ec4474..60956d4 100644 --- a/mirrorselect/selectors.py +++ b/mirrorselect/selectors.py @@ -27,6 +27,8 @@ Distributed under the terms of the GNU General Public License v2 """ +from mirrorselect.output import encoder, get_encoding, decode_selection +import http.client import math import signal import socket @@ -36,16 +38,15 @@ import sys import time import hashlib -import urllib.request, urllib.parse, urllib.error +import urllib.request +import urllib.parse +import urllib.error url_parse = urllib.parse.urlparse url_unparse = urllib.parse.urlunparse url_open = urllib.request.urlopen url_request = urllib.request.Request HTTPError = urllib.error.HTTPError -import http.client - -from mirrorselect.output import encoder, get_encoding, decode_selection # The netselect --ipv4 and --ipv6 options are supported only @@ -251,7 +252,6 @@ class Deep: self.dl_failures = 0 for host in hosts: - prog += 1 if self.test_file != "mirrorselect-test": self.output.print_info( @@ -289,7 +289,7 @@ class Deep: rethosts = [] for key in keys: # self.output.write('deeptest(): adding rethost ' - #'%s, %s' % (key, top_hosts[key]), 2) + # '%s, %s' % (key, top_hosts[key]), 2) rethosts.append(top_hosts[key]) self.output.write("deeptest(): final rethost %s\n" % (rethosts), 2) @@ -514,7 +514,6 @@ class Deep: or the slowest host. """ if len(host_dict) < maxlen: # still have room, and host is fast. add it. - self.output.write( "_list_add(): added host %s. with a time of %s\n" % (time_host[1], time_host[0]), @@ -609,7 +608,7 @@ class Interactive: dialog.extend(["20", "110", "14"]) - for (url, args) in sorted( + for url, args in sorted( hosts, key=lambda x: (x[1]["country"].lower(), x[1]["name"].lower()) ): marker = "" @@ -623,7 +622,7 @@ class Interactive: continue # dialog.append('"%s" "%s%s: %s" "OFF"' - #% ( url, marker, args['country'], args['name'])) + # % ( url, marker, args['country'], args['name'])) dialog.extend( [ "%s" % url,