diff options
| author | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-22 15:36:44 +0100 |
|---|---|---|
| committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-22 15:36:44 +0100 |
| commit | ec33eaf8fbd27986d9610abef32534aba2608fe5 (patch) | |
| tree | 994fc3f7722ab05d9440248c84ca3d9197772c14 /interfaces.py | |
| parent | a068a892c623a0697240bfe163f2aa5735ae7777 (diff) | |
| download | pylint-ec33eaf8fbd27986d9610abef32534aba2608fe5.tar.gz | |
py3k: need to handle guess_encoding in astng
Astng will try to find the right encoding and provide the right "stream"
interface for the Pylint checkers.
Reading a stream with the wrong encoding in py3k will generate a UnicodeError.
The introduced a 'F0010' failure should maybe be replaced by E0501, E0502 and
F0002? However, can we call 'unexpected errors' the ASTNGBuildingExceptions
that we raise in logilab.astng.builder?
Diffstat (limited to 'interfaces.py')
| -rw-r--r-- | interfaces.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/interfaces.py b/interfaces.py index 7bbf34e..3d7bdad 100644 --- a/interfaces.py +++ b/interfaces.py @@ -28,25 +28,25 @@ class IChecker(Interface): def open(self): """called before visiting project (i.e set of modules)""" - + def close(self): """called after visiting project (i.e set of modules)""" ## def open_module(self): ## """called before visiting a module""" - + ## def close_module(self): ## """called after visiting a module""" - - + + class IRawChecker(IChecker): """interface for checker which need to parse the raw file """ - - def process_module(self, stream): + + def process_module(self, astng): """ process a module - - the module's content is accessible via the stream object + + the module's content is accessible via astng.file_stream """ @@ -62,7 +62,7 @@ class ILinter(Interface): the linter class will generate events to its registered checkers. Each checker may interact with the linter instance using this API """ - + def register_checker(self, checker): """register a new checker class @@ -73,11 +73,11 @@ class ILinter(Interface): """add the message corresponding to the given id. If provided, msg is expanded using args - + astng checkers should provide the node argument, raw checkers should provide the line argument. """ - + class IReporter(Interface): """ reporter collect messages and display results encapsulated in a layout @@ -89,10 +89,10 @@ class IReporter(Interface): location is a 3-uple (module, object, line) msg is the actual message """ - + def display_results(self, layout): """display results encapsulated in the layout tree """ - - + + __all__ = ('IRawChecker', 'IStatable', 'ILinter', 'IReporter') |
