~ubuntu-branches/ubuntu/raring/ipython/raring

« back to all changes in this revision

Viewing changes to IPython/lib/inputhookqt4.py

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2013-02-02 11:14:27 UTC
  • mfrom: (1.2.21) (6.2.3 experimental)
  • Revision ID: package-import@ubuntu.com-20130202111427-nxxl7g1ulix8g9lg
Tags: 0.13.2~rc2-1
* New upstream release candidate (LP: #1161818, #1162112)
* pass -a to xvfb-run
* drop DM-Upload-Allowed, not needed anymore
* don't link documentation of ipython-doc so ipython3 does not depend on
  ipython (Closes: #695554)
  Requires ipython-doc.preinst to not lose copyright on upgrade
* add ipython3 and ipython3-qtconsole desktop files (Closes: #693612)
* fix detection of cython modules for multiarch python (Closes: #697704)
* don't install tests for notebook and qtconsole
* bump standard to 3.9.4, no changes required
* add autopkgtests running testsuite and testing tools, cython magics
  and incomplete install message
* fix crash on tracebacks without line numbers (Closes: #701597)
* add tkinter package to debianize-error-messages.patch (Closes: #701707)
* use canonical vcs fields in control

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
                return 0
86
86
            app.processEvents(QtCore.QEventLoop.AllEvents, 300)
87
87
            if not stdin_ready():
 
88
                # Generally a program would run QCoreApplication::exec()
 
89
                # from main() to enter and process the Qt event loop until
 
90
                # quit() or exit() is called and the program terminates.
 
91
                #
 
92
                # For our input hook integration, we need to repeatedly
 
93
                # enter and process the Qt event loop for only a short
 
94
                # amount of time (say 50ms) to ensure that Python stays
 
95
                # responsive to other user inputs.
 
96
                #
 
97
                # A naive approach would be to repeatedly call
 
98
                # QCoreApplication::exec(), using a timer to quit after a
 
99
                # short amount of time. Unfortunately, QCoreApplication
 
100
                # emits an aboutToQuit signal before stopping, which has
 
101
                # the undesirable effect of closing all modal windows.
 
102
                #
 
103
                # To work around this problem, we instead create a
 
104
                # QEventLoop and call QEventLoop::exec(). Other than
 
105
                # setting some state variables which do not seem to be
 
106
                # used anywhere, the only thing QCoreApplication adds is
 
107
                # the aboutToQuit signal which is precisely what we are
 
108
                # trying to avoid.
88
109
                timer = QtCore.QTimer()
89
 
                timer.timeout.connect(app.quit)
 
110
                event_loop = QtCore.QEventLoop()
 
111
                timer.timeout.connect(event_loop.quit)
90
112
                while not stdin_ready():
91
113
                    timer.start(50)
92
 
                    app.exec_()
 
114
                    event_loop.exec_()
93
115
                    timer.stop()
94
116
        except KeyboardInterrupt:
95
117
            ignore_CTRL_C()