diff options
| author | Jack Nagel | 2013-02-01 23:12:50 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-02-01 23:38:54 -0600 |
| commit | 0c4cd6ccf1aa0a0f74d0bb9c55334b4a18aca587 (patch) | |
| tree | 76aeea26c1ee147ebc228e354c7cc0aef369a34b /Library/Formula/pyqt.rb | |
| parent | 88ddfbb72ae2b7cd53dc58703a7895620167cec5 (diff) | |
| download | homebrew-0c4cd6ccf1aa0a0f74d0bb9c55334b4a18aca587.tar.bz2 | |
pyqt: use test DSL
Diffstat (limited to 'Library/Formula/pyqt.rb')
| -rw-r--r-- | Library/Formula/pyqt.rb | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/Library/Formula/pyqt.rb b/Library/Formula/pyqt.rb index 03f310ac9..d12781d69 100644 --- a/Library/Formula/pyqt.rb +++ b/Library/Formula/pyqt.rb @@ -32,38 +32,36 @@ class Pyqt < Formula "python" + `python -c 'import sys;print(sys.version[:3])'`.strip end - def test - # Reference: http://zetcode.com/tutorials/pyqt4/firstprograms/ - mktemp do - ENV.prepend 'PYTHONPATH', "#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages", ':' + test do + ENV.prepend 'PYTHONPATH', "#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages", ':' - (Pathname.pwd/'test.py').write <<-EOS.undent - #!/usr/bin/env python + # Reference: http://zetcode.com/tutorials/pyqt4/firstprograms/ + (testpath/'test.py').write <<-EOS.undent + #!/usr/bin/env python - import sys - from PyQt4 import QtGui, QtCore + import sys + from PyQt4 import QtGui, QtCore - class QuitButton(QtGui.QWidget): - def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) + class QuitButton(QtGui.QWidget): + def __init__(self, parent=None): + QtGui.QWidget.__init__(self, parent) - self.setGeometry(300, 300, 250, 150) - self.setWindowTitle('Quit button') + self.setGeometry(300, 300, 250, 150) + self.setWindowTitle('Quit button') - quit = QtGui.QPushButton('Close', self) - quit.setGeometry(10, 10, 60, 35) + quit = QtGui.QPushButton('Close', self) + quit.setGeometry(10, 10, 60, 35) - self.connect(quit, QtCore.SIGNAL('clicked()'), - QtGui.qApp, QtCore.SLOT('quit()')) + 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) - EOS + app = QtGui.QApplication(sys.argv) + qb = QuitButton() + qb.show() + app.exec_() + sys.exit(0) + EOS - system "python", "test.py" - end + system "python", "test.py" end end |
