Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Fix issue #98
Browse files Browse the repository at this point in the history
  • Loading branch information
fhdk committed May 15, 2017
1 parent 69f72fc commit d4d5a38
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 26 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file.

## [4.1.2] 2017-05-15
- Fix: ranking breaks when --interactive is used with --default [#98](https://github.com/manjaro/pacman-mirrors/issues/98)

## [4.1.1] 2017-05-01
- Added `-u` / `--update` option
* Run `pacman -Syy` after mirrorlist generation
Expand Down
2 changes: 1 addition & 1 deletion pacman_mirrors/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.1.1"
__version__ = "4.1.2"
50 changes: 25 additions & 25 deletions pacman_mirrors/pacman_mirrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,32 +504,32 @@ def test_mirrors(self, worklist):
ssl_wait = self.max_wait_time * 2
ssl_verify = self.config["ssl_verify"]
for mirror in worklist:
pos = mirror["url"].find(":")
url = mirror["url"][pos:]
for idx, proto in enumerate(mirror["protocols"]):
mirror["url"] = "{}{}".format(proto, url)
# pos = mirror["url"].find(":")
# url = mirror["url"][pos:]
# for idx, proto in enumerate(mirror["protocols"]):
# mirror["url"] = "{}{}".format(proto, url)
if not self.quiet:
message = " ..... {:<15}: {}".format(mirror["country"],
mirror["url"])
print("{:.{}}".format(message, cols), end="")
sys.stdout.flush()
# https sometimes takes a short while for handshake
if proto == "https" or proto == "ftps":
self.max_wait_time = ssl_wait
else:
self.max_wait_time = http_wait
# let's see how responsive you are
resp_time = httpfn.get_mirror_response(mirror["url"],
maxwait=self.max_wait_time,
quiet=self.quiet,
ssl_verify=ssl_verify)
mirror["resp_time"] = resp_time
if float(resp_time) >= self.max_wait_time:
if not self.quiet:
message = " ..... {:<15}: {}".format(mirror["country"],
mirror["url"])
print("{:.{}}".format(message, cols), end="")
sys.stdout.flush()
# https sometimes takes a short while for handshake
if proto == "https" or proto == "ftps":
self.max_wait_time = ssl_wait
else:
self.max_wait_time = http_wait
# let's see how responsive you are
resp_time = httpfn.get_mirror_response(mirror["url"],
maxwait=self.max_wait_time,
quiet=self.quiet,
ssl_verify=ssl_verify)
mirror["resp_time"] = resp_time
if float(resp_time) >= self.max_wait_time:
if not self.quiet:
print("\r")
else:
if not self.quiet:
print("\r {:<5}{}{} ".format(txt.GS, resp_time, txt.CE))
print("\r")
else:
if not self.quiet:
print("\r {:<5}{}{} ".format(txt.GS, resp_time, txt.CE))
return worklist

def run(self):
Expand Down

0 comments on commit d4d5a38

Please sign in to comment.