parsing - How to parse a signals and slot statements written in python? -
i writing python script extract particular information pyqt application. exact goal extract signals being emitted during runtime of application.
basically instrumenting(inserting code fragments) application in specific places emit code fragment written. due instrumentation during runtime getting information signals emitted.
i explain scenario:
normal scenario #a.py(actual code) #start of file pyqt4.qtgui import * pyqt4.qtcore import * .... .... self.emit(qtcore.signal("button_pressed")) .... .... #end of file instrumented scenario #a.py(actual code) #start of file pyqt4.qtgui import * pyqt4.qtcore import * .... .... signal_sent="button_pressed" print signal_sent self.emit(qtcore.signal("button_pressed")) .... .... #end of file
(**note ""button_pressed" value can assigned "signal_sent"only if able parse "emit" statement can extract string " button_pressed")
problem statement: objective parse emit statement in file can retrieve string present in signal? how can parse statement?
you can achieve same writing following emit signal:-
self.emit(qt.signal("buttonpressed(qstring)"),"button_pressed")
and following connect:-
self.connect(self, qt.signal("buttonpressed(qstring)"), self.functioncall)
Comments
Post a Comment