Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Side by Side Diff: third_party/logilab/astroid/brain/py2qt4.py

Issue 753543006: pylint: upgrade to 1.4.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 """Astroid hooks for the Python 2 qt4 module. 1 """Astroid hooks for the Python 2 qt4 module.
2 2
3 Currently help understanding of : 3 Currently help understanding of :
4 4
5 * PyQT4.QtCore 5 * PyQT4.QtCore
6 """ 6 """
7 7
8 from astroid import MANAGER 8 from astroid import MANAGER, register_module_extender
9 from astroid.builder import AstroidBuilder 9 from astroid.builder import AstroidBuilder
10 10
11 11
12 def pyqt4_qtcore_transform(module): 12 def pyqt4_qtcore_transform():
13 fake = AstroidBuilder(MANAGER).string_build(''' 13 return AstroidBuilder(MANAGER).string_build('''
14 14
15 def SIGNAL(signal_name): pass 15 def SIGNAL(signal_name): pass
16 16
17 class QObject(object): 17 class QObject(object):
18 def emit(self, signal): pass 18 def emit(self, signal): pass
19 ''') 19 ''')
20 for klass in ('QObject',):
21 module.locals[klass] = fake.locals[klass]
22 20
23 21
24 import py2stdlib 22 register_module_extender(MANAGER, 'PyQt4.QtCore', pyqt4_qtcore_transform)
25 py2stdlib.MODULE_TRANSFORMS['PyQt4.QtCore'] = pyqt4_qtcore_transform
OLDNEW
« no previous file with comments | « third_party/logilab/astroid/brain/py2pytest.py ('k') | third_party/logilab/astroid/brain/py2stdlib.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698