From 135095b6a3ade061bbe83e14318febfb4e755dbf Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Tue, 4 Oct 2016 16:26:41 -0700 Subject: [PATCH] auto-t: Add prefix for output formating --- autotests/util/iwd.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index 3251714e..60b32003 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -284,13 +284,14 @@ class Device(IWDDBusAbstract): ordered_networks.append(ordered_network) return ordered_networks - def __str__(self): - return 'Device: ' + self.device_path + '\n'\ - '\tName:\t\t' + self.name + '\n'\ - '\tAddress:\t' + self.address + '\n'\ - '\tState:\t\t' + str(self.state) + '\n'\ - '\tPowered:\t' + str(self.powered) + '\n' - #'\tConn-d net:\t' + str(self.connected_network) + '\n' + def __str__(self, prefix = ''): + return prefix + 'Device: ' + self.device_path + '\n'\ + + prefix + '\tName:\t\t' + self.name + '\n'\ + + prefix + '\tAddress:\t' + self.address + '\n'\ + + prefix + '\tState:\t\t' + str(self.state) + '\n'\ + + prefix + '\tPowered:\t' + str(self.powered) + '\n'\ + + prefix + '\tConnected net:\t' + str(self.connected_network) +\ + '\n' class Network(IWDDBusAbstract):