1 # -*- coding: utf-8 -*- |
1 # -*- coding: utf-8 -*- |
2 |
2 |
3 # Copyright (c) 2011 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> |
3 # Copyright (c) 2011 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> |
4 # |
4 # |
|
5 # pylint: disable=C0103 |
5 |
6 |
6 """ |
7 """ |
7 Module implementing the syntax check for Python 2/3. |
8 Module implementing the syntax check for Python 2/3. |
8 """ |
9 """ |
9 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
10 |
11 |
11 import re |
12 import re |
12 import sys |
13 import sys |
13 import traceback |
14 import traceback |
14 |
15 |
15 from .pyflakes.checker import Checker |
16 try: |
16 from .pyflakes.messages import ImportStarUsed |
17 from pyflakes.checker import Checker |
|
18 from pyflakes.messages import ImportStarUsed |
|
19 except ImportError: |
|
20 pass |
|
21 |
|
22 |
|
23 def initService(): |
|
24 """ |
|
25 Initialize the service and return the entry point. |
|
26 |
|
27 @return the entry point for the background client (function) |
|
28 """ |
|
29 return syntaxAndPyflakesCheck |
17 |
30 |
18 |
31 |
19 def normalizeCode(codestring): |
32 def normalizeCode(codestring): |
20 """ |
33 """ |
21 Function to normalize the given code. |
34 Function to normalize the given code. |