Description: Adapt pep8 tests for folsom  backport to precise, this is a
modification to a patch that we already cary for folsom-2 and beyond.
Author: Chuck Short <zulcss@ubuntu.com>
Forwarded: No
diff -Naupr nova-2012.2.orig/run_tests.sh nova-2012.2/run_tests.sh
--- nova-2012.2.orig/run_tests.sh	2012-05-23 07:58:04.000000000 -0500
+++ nova-2012.2/run_tests.sh	2012-08-13 11:30:04.556317154 -0500
@@ -110,7 +110,7 @@ function run_pep8 {
   #

   # Until all these issues get fixed, ignore.
-  ignore='--ignore=N4'
+  ignore='--ignore=N4,E121,E122,E271,E128,E127,E126,E123,E124,E125,E721,E711,E712,E272,E502,E711'
   ${wrapper} python tools/hacking.py ${ignore} ${srcfiles}
 }

diff -Naupr nova-2012.2.orig/tools/hacking.py nova-2012.2/tools/hacking.py
--- nova-2012.2.orig/tools/hacking.py	2012-05-23 07:57:51.000000000 -0500
+++ nova-2012.2/tools/hacking.py	2012-08-13 11:17:57.640316814 -0500
@@ -90,7 +90,7 @@ def nova_except_format(logical_line):
     N201
     """
     if logical_line.startswith("except:"):
-        return 6, "NOVA N201: no 'except:' at least use 'except Exception:'"
+        yield  6, "NOVA N201: no 'except:' at least use 'except Exception:'"


 def nova_except_format_assert(logical_line):
@@ -101,7 +101,7 @@ def nova_except_format_assert(logical_li
     N202
     """
     if logical_line.startswith("self.assertRaises(Exception"):
-        return 1, "NOVA N202: assertRaises Exception too broad"
+        yield 1, "NOVA N202: assertRaises Exception too broad"


 def nova_one_import_per_line(logical_line):
@@ -119,7 +119,7 @@ def nova_one_import_per_line(logical_lin
     if pos > -1 and (parts[0] == "import" or
        parts[0] == "from" and parts[2] == "import") and \
        not is_import_exception(parts[1]):
-        return pos, "NOVA N301: one import per line"
+        yield pos, "NOVA N301: one import per line"

 _missingImport = set([])

@@ -193,7 +193,9 @@ def nova_import_module_only(logical_line
             (len(split_line) == 2 or
             (len(split_line) == 4 and split_line[2] == "as"))):
         mod = split_line[1]
-        return importModuleCheck(mod)
+        rval = importModuleCheck(mod)
+        if rval != None:
+            yield rval

     # TODO(jogo) handle "from x import *"

@@ -348,7 +350,7 @@ def nova_localization_strings(logical_li
         map(gen.send, tokens)
         gen.close()
     except LocalizationError as e:
-        return e.args
+        yield e.args

 #TODO(jogo) Dict and list objects

