- for filename in fnmatch.filter(filenames, '*.xml'):
- print root, dirnames, filename
- path = os.path.join(root, filename)
- xml = open(path).read()
-
- power_formats = formats([( "1E0", "f"),
- ( "1E3", "kf"),
- ( "1E6", "Mf"),
- ( "1E9", "Gf"),
- ("1E12", "Tf"),
- ("1E15", "Pt"),
- ("1E18", "Ef"),
- ("1E21", "Zf")])
- xml = format(xml, power_formats, "power")
-
- bandwidth_formats = formats([( "1E0", "Bps"),
- ( "1E3", "kBps"),
- ( "1E6", "MBps"),
- ( "1E9", "GBps"),
- ("1E12", "TBps")])
- xml = format(xml, bandwidth_formats, "bandwidth")
- xml = format(xml, bandwidth_formats, "bw")
- xml = format(xml, bandwidth_formats, "bb_bw")
- xml = format(xml, bandwidth_formats, "bw_in")
- xml = format(xml, bandwidth_formats, "bw_out")
-
- time_formats = formats([( "1E-12", "ps"),
- ( "1E-9" , "ns"),
- ( "1E-6" , "us"),
- ( "1E-3" , "ms"),
- ( "1E0" , "s"),
- ( "60E0" , "m"),
- ( "3600E0" , "h"),
- ( "86400E0" , "d"),
- ("604800E0" , "w")])
- xml = format(xml, time_formats, "latency")
- xml = format(xml, time_formats, "lat")
- xml = format(xml, time_formats, "bb_lat")
-
- #print xml
- file = open(path, "w")
- file.write(xml)
- file.close()
+ for filename in fnmatch.filter(filenames, '*.xml'):
+ print root, dirnames, filename
+ path = os.path.join(root, filename)
+ xml = open(path).read()
+
+ power_formats = formats([("1E0", "f"),
+ ("1E3", "kf"),
+ ("1E6", "Mf"),
+ ("1E9", "Gf"),
+ ("1E12", "Tf"),
+ ("1E15", "Pt"),
+ ("1E18", "Ef"),
+ ("1E21", "Zf")])
+ xml = format(xml, power_formats, "power")
+
+ bandwidth_formats = formats([("1E0", "Bps"),
+ ("1E3", "kBps"),
+ ("1E6", "MBps"),
+ ("1E9", "GBps"),
+ ("1E12", "TBps")])
+ xml = format(xml, bandwidth_formats, "bandwidth")
+ xml = format(xml, bandwidth_formats, "bw")
+ xml = format(xml, bandwidth_formats, "bb_bw")
+ xml = format(xml, bandwidth_formats, "bw_in")
+ xml = format(xml, bandwidth_formats, "bw_out")
+
+ time_formats = formats([("1E-12", "ps"),
+ ("1E-9", "ns"),
+ ("1E-6", "us"),
+ ("1E-3", "ms"),
+ ("1E0", "s"),
+ ("60E0", "m"),
+ ("3600E0", "h"),
+ ("86400E0", "d"),
+ ("604800E0", "w")])
+ xml = format(xml, time_formats, "latency")
+ xml = format(xml, time_formats, "lat")
+ xml = format(xml, time_formats, "bb_lat")
+
+ # print xml
+ file = open(path, "w")
+ file.write(xml)
+ file.close()