Lines 65-70
class Shallow(object):
Link Here
|
65 |
"""handles rapid server selection via netselect""" |
65 |
"""handles rapid server selection via netselect""" |
66 |
|
66 |
|
67 |
def __init__(self, hosts, options, output): |
67 |
def __init__(self, hosts, options, output): |
|
|
68 |
self._options = options |
68 |
self.output = output |
69 |
self.output = output |
69 |
self.urls = [] |
70 |
self.urls = [] |
70 |
|
71 |
|
Lines 94-103
class Shallow(object):
Link Here
|
94 |
|
95 |
|
95 |
host_string = ' '.join(hosts) |
96 |
host_string = ' '.join(hosts) |
96 |
|
97 |
|
97 |
self.output.write('\nnetselect(): running "netselect -s%d %s"\n' |
98 |
cmd = ['netselect', '-s%d' % (number,)] |
98 |
% (int(number), host_string), 2) |
99 |
if self._options.ipv4: |
|
|
100 |
cmd.append('-4') |
101 |
elif self._options.ipv6: |
102 |
cmd.append('-6') |
99 |
|
103 |
|
100 |
proc = subprocess.Popen( ['netselect', '-s%d' % (number,)] + hosts, |
104 |
cmd.extend(hosts) |
|
|
105 |
|
106 |
self.output.write('\nnetselect(): running "%s"\n' |
107 |
% ' '.join(cmd), 2) |
108 |
|
109 |
proc = subprocess.Popen(cmd, |
101 |
stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
110 |
stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
102 |
|
111 |
|
103 |
out, err = proc.communicate() |
112 |
out, err = proc.communicate() |
104 |
- |
|
|