diff options
| author | Samuel John | 2013-06-05 10:26:57 +0200 |
|---|---|---|
| committer | Samuel John | 2013-06-05 10:26:57 +0200 |
| commit | 7c9dca49b4166e01d1c64253d16bf3050823311d (patch) | |
| tree | 493e7042dc4efe79f24ba807fca3b349ec0668c6 /Library/Formula | |
| parent | a6bb18c0bf64385f87297174af51c97e8b855017 (diff) | |
| download | homebrew-7c9dca49b4166e01d1c64253d16bf3050823311d.tar.bz2 | |
PyQt: brew test automatically quits after 2.5 sec.
Blocking tests are bad for brew-test-bot.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/pyqt.rb | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/Library/Formula/pyqt.rb b/Library/Formula/pyqt.rb index 20898543c..67fea3cac 100644 --- a/Library/Formula/pyqt.rb +++ b/Library/Formula/pyqt.rb @@ -35,31 +35,23 @@ class Pyqt < Formula test do python do - # Todo: For brew-test-bot we need to add a timer that quits after 1 s or so. - # Reference: http://zetcode.com/tutorials/pyqt4/firstprograms/ (testpath/'test.py').write <<-EOS.undent import sys from PyQt4 import QtGui, QtCore - class QuitButton(QtGui.QWidget): + class Test(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) - - self.setGeometry(300, 300, 250, 150) - self.setWindowTitle('Quit button') - - quit = QtGui.QPushButton('Close', self) - quit.setGeometry(10, 10, 60, 35) - - self.connect(quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) - - app = QtGui.QApplication(sys.argv) - qb = QuitButton() - qb.show() - app.exec_() - sys.exit(0) + self.setGeometry(300, 300, 400, 150) + self.setWindowTitle('Homebrew') + QtGui.QLabel("Python #{python.version} working with PyQt4. Quitting now...", self).move(50, 50) + QtCore.QTimer.singleShot(2500, QtGui.qApp, QtCore.SLOT('quit()')) + + app = QtGui.QApplication([]) + window = Test() + window.show() + sys.exit(app.exec_()) EOS system python, "test.py" |
