-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
- data = []
-
- for line in f:
- # match traceroute to ...
- m = re.match(_rre, line)
- if not m:
- continue
-
- target_ip = m.groupdict()["ip"]
- # FIX THIS: Make sure the regular expression does not inlcude
- # the ')' in the ip group
- target_ip = target_ip.replace(")","")
- target_hostname = m.groupdict()["hostname"]
- time = m.groupdict()["time"]
- data.append((target_ip, target_hostname, time))
-
- f.close()
+ data = []
+
+ for line in f:
+ # match traceroute to ...
+ m = re.match(_rre, line)
+ if not m:
+ continue
+
+ target_ip = m.groupdict()["ip"]
+ # FIX THIS: Make sure the regular expression does not inlcude
+ # the ')' in the ip group
+ target_ip = target_ip.replace(")","")
+ target_hostname = m.groupdict()["hostname"]
+ time = m.groupdict()["time"]
+ data.append((target_ip, target_hostname, time))
for dirpath, dnames, fnames in os.walk(logs_dir):
# continue if we are not at the leaf level (if there are subdirectories)
if dnames:
for dirpath, dnames, fnames in os.walk(logs_dir):
# continue if we are not at the leaf level (if there are subdirectories)
if dnames:
filename = os.path.join(dirpath, fname)
data = parse_file(filename)
annotate_cn_node(graph, nid, ips2nid, data)
filename = os.path.join(dirpath, fname)
data = parse_file(filename)
annotate_cn_node(graph, nid, ips2nid, data)
# Take as weight the most frequent value
for nid1, nid2 in graph.edges():
delays = collections.Counter(graph.edge[nid1][nid2]["delays"])
# Take as weight the most frequent value
for nid1, nid2 in graph.edges():
delays = collections.Counter(graph.edge[nid1][nid2]["delays"])