diff --git a/Tools/LogAnalyzer/DataflashLog.py b/Tools/LogAnalyzer/DataflashLog.py index 03a06a927b..1c71f325af 100644 --- a/Tools/LogAnalyzer/DataflashLog.py +++ b/Tools/LogAnalyzer/DataflashLog.py @@ -25,7 +25,7 @@ class Format(object): self.labels = labels.split(',') def __str__(self): - return "%8s %s" % (self.name, `self.labels`) + return "%8s %s" % (self.name, repr(self.labels)) @staticmethod def trycastToFormatType(value,valueType): diff --git a/Tools/LogAnalyzer/LogAnalyzer.py b/Tools/LogAnalyzer/LogAnalyzer.py index 44213d8471..a083df29f7 100755 --- a/Tools/LogAnalyzer/LogAnalyzer.py +++ b/Tools/LogAnalyzer/LogAnalyzer.py @@ -157,8 +157,8 @@ class TestSuite(object): xml.write("\n") xml.write("
\n") xml.write(" " + escape(self.logfile) + "\n") - xml.write(" " + escape(`self.logdata.filesizeKB`) + "\n") - xml.write(" " + escape(`self.logdata.lineCount`) + "\n") + xml.write(" " + escape(repr(self.logdata.filesizeKB)) + "\n") + xml.write(" " + escape(repr(self.logdata.lineCount)) + "\n") xml.write(" " + escape(str(datetime.timedelta(seconds=self.logdata.durationSecs))) + "\n") xml.write(" " + escape(self.logdata.vehicleTypeString) + "\n") if self.logdata.vehicleType == VehicleType.Copter and self.logdata.getCopterType(): @@ -166,14 +166,14 @@ class TestSuite(object): xml.write(" " + escape(self.logdata.firmwareVersion) + "\n") xml.write(" " + escape(self.logdata.firmwareHash) + "\n") xml.write(" " + escape(self.logdata.hardwareType) + "\n") - xml.write(" " + escape(`self.logdata.freeRAM`) + "\n") - xml.write(" " + escape(`self.logdata.skippedLines`) + "\n") + xml.write(" " + escape(repr(self.logdata.freeRAM)) + "\n") + xml.write(" " + escape(repr(self.logdata.skippedLines)) + "\n") xml.write("
\n") # output parameters xml.write("\n") for param, value in self.logdata.parameters.items(): - xml.write(" \n" % (param,escape(`value`))) + xml.write(" \n" % (param,escape(repr(value)))) xml.write("\n") # output test results diff --git a/Tools/LogAnalyzer/tests/TestDualGyroDrift.py b/Tools/LogAnalyzer/tests/TestDualGyroDrift.py index 5101c0b73f..cc92f97ab5 100644 --- a/Tools/LogAnalyzer/tests/TestDualGyroDrift.py +++ b/Tools/LogAnalyzer/tests/TestDualGyroDrift.py @@ -70,15 +70,15 @@ class TestDualGyroDrift(Test): # #pylab.plot(range(0,(nSamples*sliceLength1),sliceLength1), imu1ZAverages, 'b') - # print("Gyro averages1X: " + `imu1XAverages`) - # print("Gyro averages1Y: " + `imu1YAverages`) - # print("Gyro averages1Z: " + `imu1ZAverages` + "\n") - # print("Gyro averages2X: " + `imu2XAverages`) - # print("Gyro averages2Y: " + `imu2YAverages`) - # print("Gyro averages2Z: " + `imu2ZAverages` + "\n") - # print("Gyro averages diff X: " + `imuXDiffAverages`) - # print("Gyro averages diff Y: " + `imuYDiffAverages`) - # print("Gyro averages diff Z: " + `imuZDiffAverages`) + # print("Gyro averages1X: " + repr(imu1XAverages)) + # print("Gyro averages1Y: " + repr(imu1YAverages)) + # print("Gyro averages1Z: " + repr(imu1ZAverages) + "\n") + # print("Gyro averages2X: " + repr(imu2XAverages)) + # print("Gyro averages2Y: " + repr(imu2YAverages)) + # print("Gyro averages2Z: " + repr(imu2ZAverages) + "\n") + # print("Gyro averages diff X: " + repr(imuXDiffAverages)) + # print("Gyro averages diff Y: " + repr(imuYDiffAverages)) + # print("Gyro averages diff Z: " + repr(imuZDiffAverages)) # # lowpass filter using numpy # # cutoff = 100 diff --git a/Tools/LogAnalyzer/tests/TestMotorBalance.py b/Tools/LogAnalyzer/tests/TestMotorBalance.py index f89baa0f29..85e9e7f1f8 100644 --- a/Tools/LogAnalyzer/tests/TestMotorBalance.py +++ b/Tools/LogAnalyzer/tests/TestMotorBalance.py @@ -25,8 +25,8 @@ class TestBalanceTwist(Test): for i in range(8): for prefix in "Chan", "Ch", "C": - if prefix+`(i+1)` in logdata.channels["RCOU"]: - ch.append(map(lambda x: x[1], logdata.channels["RCOU"][prefix+`(i+1)`].listData)) + if prefix+repr((i+1)) in logdata.channels["RCOU"]: + ch.append(map(lambda x: x[1], logdata.channels["RCOU"][prefix+repr((i+1))].listData)) ch = zip(*ch) num_channels = 0 diff --git a/Tools/LogAnalyzer/tests/TestParams.py b/Tools/LogAnalyzer/tests/TestParams.py index c8a8ffe069..aefc8050bc 100644 --- a/Tools/LogAnalyzer/tests/TestParams.py +++ b/Tools/LogAnalyzer/tests/TestParams.py @@ -17,17 +17,17 @@ class TestParams(Test): value = logdata.parameters[paramName] if value != expectedValue: self.result.status = TestResult.StatusType.FAIL - self.result.statusMessage = self.result.statusMessage + "%s set to %s, expecting %s\n" % (paramName, `value`, `expectedValue`) + self.result.statusMessage = self.result.statusMessage + "%s set to %s, expecting %s\n" % (paramName, repr(value), repr(expectedValue)) def __checkParamIsLessThan(self, paramName, maxValue, logdata): value = logdata.parameters[paramName] if value >= maxValue: self.result.status = TestResult.StatusType.FAIL - self.result.statusMessage = self.result.statusMessage + "%s set to %s, expecting less than %s\n" % (paramName, `value`, `maxValue`) + self.result.statusMessage = self.result.statusMessage + "%s set to %s, expecting less than %s\n" % (paramName, repr(value), repr(maxValue)) def __checkParamIsMoreThan(self, paramName, minValue, logdata): value = logdata.parameters[paramName] if value <= minValue: self.result.status = TestResult.StatusType.FAIL - self.result.statusMessage = self.result.statusMessage + "%s set to %s, expecting less than %s\n" % (paramName, `value`, `minValue`) + self.result.statusMessage = self.result.statusMessage + "%s set to %s, expecting less than %s\n" % (paramName, repr(value), repr(minValue)) def run(self, logdata, verbose): @@ -60,4 +60,4 @@ class TestParams(Test): self.result.statusMessage = "Bad parameters found:\n" + self.result.statusMessage except KeyError as e: self.result.status = TestResult.StatusType.FAIL - self.result.statusMessage = str(e) + ' not found' \ No newline at end of file + self.result.statusMessage = str(e) + ' not found' diff --git a/Tools/LogAnalyzer/tests/TestVCC.py b/Tools/LogAnalyzer/tests/TestVCC.py index e0fe5b5af5..95cd833943 100644 --- a/Tools/LogAnalyzer/tests/TestVCC.py +++ b/Tools/LogAnalyzer/tests/TestVCC.py @@ -38,5 +38,5 @@ class TestVCC(Test): self.result.statusMessage = "VCC min/max diff %sv, should be <%sv" % (vccDiff/1000.0, vccMaxDiff/1000.0) elif vccMin < vccMinThreshold: self.result.status = TestResult.StatusType.FAIL - self.result.statusMessage = "VCC below minimum of %sv (%sv)" % (`vccMinThreshold/1000.0`,`vccMin/1000.0`) + self.result.statusMessage = "VCC below minimum of %sv (%sv)" % (repr(vccMinThreshold/1000.0),repr(vccMin/1000.0)) diff --git a/Tools/LogAnalyzer/tests/TestVibration.py b/Tools/LogAnalyzer/tests/TestVibration.py index 262d6a5b8a..edf18f2acd 100644 --- a/Tools/LogAnalyzer/tests/TestVibration.py +++ b/Tools/LogAnalyzer/tests/TestVibration.py @@ -45,7 +45,7 @@ class TestVibration(Test): # TODO: accumulate all LOITER chunks over min size, or just use the largest one? startLine = chunks[0][0] endLine = chunks[0][1] - #print("TestVibration using LOITER chunk from lines %s to %s" % (`startLine`, `endLine`)) + #print("TestVibration using LOITER chunk from lines %s to %s" % (repr(startLine), repr(endLine))) def getStdDevIMU(logdata, channelName, startLine,endLine): loiterData = logdata.channels["IMU"][channelName].getSegment(startLine,endLine)