[apycotlib] manage preprocessors like checkers
authorDavid Douard <david.douard@logilab.fr>
Thu, 24 Oct 2013 16:46:24 +0200
changeset 1458 2c4842747f04
parent 1457 d0021a81d8fc
child 1459 ffe0a265ba3e
[apycotlib] manage preprocessors like checkers they should be installed in /usr/share/narval/
__init__.py
_apycotlib/checkers/python.py
_apycotlib/narvalactions.py
_apycotlib/preprocessors/__init__.py
_apycotlib/preprocessors/distutils.py
--- a/__init__.py	Tue Apr 08 12:17:40 2014 +0200
+++ b/__init__.py	Thu Oct 24 16:46:24 2013 +0200
@@ -14,3 +14,6 @@
     import _apycotlib.checkers
     sys.modules['checkers'] = _apycotlib.checkers
     sys.modules['checkers.apycot'] = _apycotlib.checkers
+    import _apycotlib.preprocessors
+    sys.modules['preprocessors'] = _apycotlib.preprocessors
+    sys.modules['preprocessors.apycot'] = _apycotlib.preprocessors
--- a/_apycotlib/checkers/python.py	Tue Apr 08 12:17:40 2014 +0200
+++ b/_apycotlib/checkers/python.py	Thu Oct 24 16:46:24 2013 +0200
@@ -36,8 +36,8 @@
 from apycotlib import register
 from apycotlib import SUCCESS, FAILURE, PARTIAL, NODATA, ERROR
 from apycotlib import SimpleOutputParser, ParsedCommand
-from apycotlib.preprocessors.distutils import INSTALL_PREFIX, pyversions
 
+from preprocessors.apycot.distutils import INSTALL_PREFIX, pyversions
 from checkers.apycot import BaseChecker, AbstractFilteredFileChecker
 
 def pyinstall_path(test):
--- a/_apycotlib/narvalactions.py	Tue Apr 08 12:17:40 2014 +0200
+++ b/_apycotlib/narvalactions.py	Thu Oct 24 16:46:24 2013 +0200
@@ -1,5 +1,4 @@
 from apycotlib import atest, writer, ERROR
-from apycotlib import preprocessors # trigger registration
 
 class apycot_environment(object):
     def __init__(self, plan):
--- a/_apycotlib/preprocessors/__init__.py	Tue Apr 08 12:17:40 2014 +0200
+++ b/_apycotlib/preprocessors/__init__.py	Thu Oct 24 16:46:24 2013 +0200
@@ -12,5 +12,3 @@
     def run(self, test, path):
         """Run preprocessor against source in <path> in <test> context"""
         raise NotImplementedError()
-
-from apycotlib.preprocessors import distutils
--- a/_apycotlib/preprocessors/distutils.py	Tue Apr 08 12:17:40 2014 +0200
+++ b/_apycotlib/preprocessors/distutils.py	Thu Oct 24 16:46:24 2013 +0200
@@ -20,7 +20,8 @@
 
 from apycotlib import register, SetupException
 from apycotlib import Command
-from apycotlib.preprocessors import BasePreProcessor
+
+from preprocessors.apycot import BasePreProcessor
 
 def pyversion_available(python):
     return not os.system('%s -V 2>/dev/null' % python)