X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos.py;h=e4255177a62557bcab7a05d8b93225df8e0479c8;hb=cf36efa296379eb024dd593fc2806a42093e6c97;hp=05ecf7af3c927fab08717f255d356d0681fda27c;hpb=ed0d4c55052f6f98007ea0e91e6c90fe8809425a;p=bertos.git diff --git a/wizard/bertos.py b/wizard/bertos.py index 05ecf7af..e4255177 100755 --- a/wizard/bertos.py +++ b/wizard/bertos.py @@ -61,6 +61,7 @@ from BFinalPage import BFinalPage from BEditingDialog import BEditingDialog, BVersionDialog, BToolchainDialog import bertos_utils +import const from LoadException import VersionException, ToolchainException @@ -79,7 +80,7 @@ def newProject(): relevant_file = relevant_files[ide] QProcess.startDetached(command_line, [relevant_file,]) sys.exit() - + def editProject(project_file): info_dict = {} while(True): @@ -119,19 +120,20 @@ def showStartPage(): QApplication.instance().dialog.show() def main(): - os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) app = QApplication(sys.argv) app.settings = QSettings("Develer", "Bertos Configurator") app.project = BProject.BProject() # Development utility lines, to be removed for production - if not (hasattr(sys, "frozen") and sys.frozen) and newer("bertos.qrc", "bertos.rcc"): - os.system("rcc -binary bertos.qrc -o bertos.rcc") - QResource.registerResource("bertos.rcc") + datadir = const.DATA_DIR + qrc, rcc = os.path.join(datadir, 'bertos.qrc'), os.path.join(datadir, 'bertos.rcc') + if not (hasattr(sys, "frozen") and sys.frozen) and newer(qrc, rcc): + os.system("rcc -binary %s -o %s" %(qrc, rcc)) + QResource.registerResource(rcc) if len(sys.argv) == 3 and sys.argv[1] == "--edit": editProject(sys.argv[2]) else: newProject() - + if __name__ == '__main__': main()