File: py2qt4.py

package info (click to toggle)
logilab-astng 0.24.3-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 700 kB
  • ctags: 1,300
  • sloc: python: 7,563; makefile: 56; sh: 15
file content (25 lines) | stat: -rw-r--r-- 531 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""ASTNG hooks for the Python 2 qt4 module.

Currently help understanding of :

* PyQT4.QtCore
"""

from logilab.astng import MANAGER
from logilab.astng.builder import ASTNGBuilder


def pyqt4_qtcore_transform(module):
    fake = ASTNGBuilder(MANAGER).string_build('''

def SIGNAL(signal_name): pass

class QObject(object):
    def emit(self, signal): pass
''')
    for klass in ('QObject',):
        module.locals[klass] = fake.locals[klass]


import py2stdlib
py2stdlib.MODULE_TRANSFORMS['PyQt4.QtCore'] = pyqt4_qtcore_transform