projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Python style/portability fix
[fio.git]
/
tools
/
fiologparser.py
diff --git
a/tools/fiologparser.py
b/tools/fiologparser.py
index 685f4194aadfe85b65210055a4e446c436997d38..5a95009e4c1208a5c3a3a0d1ecdd0a7dc170023b 100755
(executable)
--- a/
tools/fiologparser.py
+++ b/
tools/fiologparser.py
@@
-45,7
+45,7
@@
def print_full(ctx, series):
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
- print
"%s, %s" % (end, ', '.join(["%0.3f" % i for i in results]
))
+ print
("%s, %s" % (end, ', '.join(["%0.3f" % i for i in results])
))
start += ctx.interval
end += ctx.interval
start += ctx.interval
end += ctx.interval
@@
-57,7
+57,7
@@
def print_sums(ctx, series):
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
- print
"%s, %0.3f" % (end, sum(results
))
+ print
("%s, %0.3f" % (end, sum(results)
))
start += ctx.interval
end += ctx.interval
start += ctx.interval
end += ctx.interval
@@
-69,7
+69,7
@@
def print_averages(ctx, series):
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
while (start < ftime):
end = ftime if ftime < end else end
results = [ts.get_value(start, end) for ts in series]
- print
"%s, %0.3f" % (end, float(sum(results))/len(results
))
+ print
("%s, %0.3f" % (end, float(sum(results))/len(results)
))
start += ctx.interval
end += ctx.interval
start += ctx.interval
end += ctx.interval
@@
-147,11
+147,11
@@
def print_default(ctx, series):
end += ctx.interval
total = 0
end += ctx.interval
total = 0
- for i in
x
range(0, len(averages)):
+ for i in range(0, len(averages)):
total += averages[i]*weights[i]
total += averages[i]*weights[i]
- print
'%0.3f' % (total/sum(weights
))
+ print
('%0.3f' % (total/sum(weights)
))
-class TimeSeries():
+class TimeSeries(
object
):
def __init__(self, ctx, fn):
self.ctx = ctx
self.last = None
def __init__(self, ctx, fn):
self.ctx = ctx
self.last = None
@@
-185,7
+185,7
@@
class TimeSeries():
value += sample.get_contribution(start, end)
return value
value += sample.get_contribution(start, end)
return value
-class Sample():
+class Sample(
object
):
def __init__(self, ctx, start, end, value):
self.ctx = ctx
self.start = start
def __init__(self, ctx, start, end, value):
self.ctx = ctx
self.start = start