KVM test: Move top level docstrings, other cleanups

In order to prepare for the subsequent changes, made
some cleanups on the kvm source files: I've noticed
that the top level docstrings were going before the
imports block, and that does not follow the pattern
found on other files (my fault). This patch fixes
that problem and fixed some places on scan_results.py
where 80 char line width was not being obeyed. Also,
cleaned up the last places where we were using the
shebang #/usr/bin/env python, which is not the
preferred usage of the shebang across the project.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3701 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/kvm/scan_results.py b/client/tests/kvm/scan_results.py
index a22634e..f7bafa9 100755
--- a/client/tests/kvm/scan_results.py
+++ b/client/tests/kvm/scan_results.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python
 """
 Program that parses the autotest results and return a nicely printed final test
 result.
@@ -7,7 +7,11 @@
 """
 
 def parse_results(text):
-    """Parse text containing Autotest results and return a list of result 4-tuples."""
+    """
+    Parse text containing Autotest results.
+
+    @return: A list of result 4-tuples.
+    """
     result_list = []
     start_time_list = []
     info_list = []
@@ -18,13 +22,15 @@
         parts = line.split("\t")
 
         # Found a START line -- get start time
-        if line.startswith("START") and len(parts) >= 5 and parts[3].startswith("timestamp"):
+        if (line.startswith("START") and len(parts) >= 5 and
+            parts[3].startswith("timestamp")):
             start_time = float(parts[3].split('=')[1])
             start_time_list.append(start_time)
             info_list.append("")
 
         # Found an END line -- get end time, name and status
-        elif line.startswith("END") and len(parts) >= 5 and parts[3].startswith("timestamp"):
+        elif (line.startswith("END") and len(parts) >= 5 and
+              parts[3].startswith("timestamp")):
             end_time = float(parts[3].split('=')[1])
             start_time = start_time_list.pop()
             info = info_list.pop()
@@ -33,10 +39,12 @@
             # Remove 'kvm.' prefix
             if test_name.startswith("kvm."):
                 test_name = test_name.split("kvm.")[1]
-            result_list.append((test_name, test_status, int(end_time - start_time), info))
+            result_list.append((test_name, test_status,
+                                int(end_time - start_time), info))
 
         # Found a FAIL/ERROR/GOOD line -- get failure/success info
-        elif len(parts) >= 6 and parts[3].startswith("timestamp") and parts[4].startswith("localtime"):
+        elif (len(parts) >= 6 and parts[3].startswith("timestamp") and
+              parts[4].startswith("localtime")):
             info_list[-1] = parts[5]
 
     return result_list