[dts] [PATCH] framework: fix pep8 issue in source code

Yong Liu yong.liu at intel.com
Sun Feb 15 06:45:30 CET 2015


All python code in DTS should follow pep8 code styple. Fixed some code not
match pep8 and ingore E501(line too long).

Signed-off-by: Marvinliu <yong.liu at intel.com>

diff --git a/framework/dut.py b/framework/dut.py
index 161c3fc..267e7f1 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -170,7 +170,6 @@ class Dut(Crb):
         if self.ports_map is None or len(self.ports_map) == 0:
             raise ValueError("ports_map should not be empty, please check all links")
 
-
     def restore_interfaces(self):
         """
         Restore all ports's interfaces.
@@ -234,7 +233,7 @@ class Dut(Crb):
                 arch_huge_pages = hugepages if hugepages > 0 else 1024
             elif self.architecture == "i686":
                 arch_huge_pages = hugepages if hugepages > 0 else 512
-            #set huge pagesize for x86_x32 abi target
+            # set huge pagesize for x86_x32 abi target
             elif self.architecture == "x86_x32":
                 arch_huge_pages = hugepages if hugepages > 0 else 256
 
diff --git a/framework/settings.py b/framework/settings.py
index 7f192d0..41c9c2c 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -32,9 +32,9 @@
 Folders for framework running enviornment.
 """
 FOLDERS = {
-    'Framework'     : 'framework',
-    'Testscripts'   : 'tests',
-    'Configuration' : 'conf',
+    'Framework': 'framework',
+    'Testscripts': 'tests',
+    'Configuration': 'conf',
 }
 
 """
@@ -94,7 +94,7 @@ DRIVERS = {
     'I218LM': 'igb',
     'fortville_eagle': 'i40e',
     'fortville_spirit': 'i40e',
-    'fortville_spirit_single':'i40e',
+    'fortville_spirit_single': 'i40e',
     'redrockcanyou': 'fm10k',
 }
 
diff --git a/framework/ssh_connection.py b/framework/ssh_connection.py
index f3debc1..fb9043a 100644
--- a/framework/ssh_connection.py
+++ b/framework/ssh_connection.py
@@ -61,8 +61,8 @@ class SSHConnection(object):
     def isalive(self):
         return self.session.isalive()
 
-    def copy_file_from(self, src, dst = ".", password=''):
+    def copy_file_from(self, src, dst=".", password=''):
         self.session.copy_file_from(src, dst, password)
 
-    def copy_file_to(self, src, dst = "~/", password=''):
+    def copy_file_to(self, src, dst="~/", password=''):
         self.session.copy_file_to(src, dst, password)
diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py
index d293fe2..d85c2eb 100644
--- a/framework/ssh_pexpect.py
+++ b/framework/ssh_pexpect.py
@@ -78,7 +78,7 @@ class SSHPexpect(object):
     def isalive(self):
         return self.session.isalive()
 
-    def copy_file_from(self, src, dst = ".", password=''):
+    def copy_file_from(self, src, dst=".", password=''):
         """
         Copies a file from a remote place into local.
         """
@@ -88,7 +88,7 @@ class SSHPexpect(object):
         else:
             self._spawn_scp(command, password)
 
-    def copy_file_to(self, src, dst = "~/", password=''):
+    def copy_file_to(self, src, dst="~/", password=''):
         """
         Sends a local file to a remote place.
         """
diff --git a/framework/test_case.py b/framework/test_case.py
index c5dd10f..66f7262 100644
--- a/framework/test_case.py
+++ b/framework/test_case.py
@@ -79,6 +79,6 @@ class TestCase(object):
         elif self.nic in ["fortville_spirit", "fortville_spirit_single"]:
             bitrate *= 40
         elif self.nic == 'fortville_eagle':
-           bitrate *= 10
+            bitrate *= 10
 
         return bitrate * num_ports / 8 / (frame_size + 20)
-- 
1.9.3



More information about the dts mailing list