Source

codeaide / demo.py

Full commit
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
try:
    from PyQt4.QtCore import Qt
    from PyQt4.QtGui import QApplication, QSplitter, QMainWindow
except ImportError, e:
    print e
    print "You have to install the python-pyqt4 package"
    sys.exit(255)


from codeaide.editors import PythonEditor, PythonConsole


class IDE(QMainWindow):
    
    def __init__(self):
        QMainWindow.__init__(self)
        self.splitter = QSplitter(Qt.Vertical, self)
        self.setCentralWidget(self.splitter)
        self.edit = PythonEditor(self.splitter)
        self.edit.install("EmacsCore")
        src = open("demo.py").read()
        self.edit.setPlainText(src)
        #self.edit.load_buffer("demo.py")
        self.console = PythonConsole(self.splitter)

        self.splitter.setStretchFactor(0, 1)
        self.resize(800, 600)
    


def main():
    app = QApplication(sys.argv)
    win = IDE()
    win.show()
    return app.exec_()


if __name__ == "__main__":
    sys.exit(main() or 0)