Add the import for the os module
[bertos.git] / wizard / bertos.py
1 #!/usr/bin/env python
2 # encoding: utf-8
3 #
4 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
5 # All rights reserved.
6 #
7 # $Id:$
8 #
9 # Author: Lorenzo Berni <duplo@develer.com>
10 #
11
12 import os
13 import sys
14 from distutils.dep_util import newer
15
16 from PyQt4.QtCore import *
17 from PyQt4.QtGui import *
18
19 import BProject
20
21 import BStartPage
22 import BWizard
23
24 def newProject():
25     wizard = BWizard.BWizard()
26     wizard.show()
27     wizard.exec_()
28     
29 def editProject():
30     print "editProject"
31
32 def showStartPage():
33     QApplication.instance().dialog = BStartPage.BStartPage()
34     QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("newProject"), newProject)
35     QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("editProject"), editProject)
36     QApplication.instance().dialog.show()
37
38 def main():
39     app = QApplication(sys.argv)
40     app.settings = QSettings("Develer", "Bertos Configurator")
41     app.project = BProject.BProject()
42     if newer("bertos.qrc", "bertos.rcc"):
43         os.system("rcc -binary bertos.qrc > bertos.rcc")
44     QResource.registerResource("bertos.rcc")
45     showStartPage()
46     sys.exit(app.exec_())
47
48 if __name__ == '__main__':
49     main()
50