From b184b8dae2e3dffa463932855a77f7566788620e Mon Sep 17 00:00:00 2001 From: duplo Date: Wed, 22 Apr 2009 14:17:23 +0000 Subject: [PATCH] Now the wizard can launch the IDE. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2633 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos.py | 12 +++++++++++- wizard/plugins/codelite.py | 8 ++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/wizard/bertos.py b/wizard/bertos.py index 695a8627..ca6072e4 100755 --- a/wizard/bertos.py +++ b/wizard/bertos.py @@ -38,6 +38,17 @@ def newProject(): wizard = BWizard.BWizard(page_list) wizard.show() wizard.exec_() + project = QApplication.instance().project + to_be_opened = project.info("TO_BE_OPENED") + command_lines = project.info("COMMAND_LINES") + relevant_files = project.info("RELEVANT_FILES") + if to_be_opened: + for ide in to_be_opened: + command_line = command_lines[ide] + relevant_file = relevant_files[ide] + import subprocess + subprocess.call(command_line + " \"" + relevant_file + "\"") + sys.exit() def editProject(): page_list = [BOpenPage, BVersionPage, BCpuPage, BToolchainPage, BModulePage, BOutputPage, BCreationPage, BFinalPage] @@ -71,7 +82,6 @@ def main(): pass else: newProject() - sys.exit(app.exec_()) if __name__ == '__main__': main() diff --git a/wizard/plugins/codelite.py b/wizard/plugins/codelite.py index d286f57e..00de3d12 100644 --- a/wizard/plugins/codelite.py +++ b/wizard/plugins/codelite.py @@ -24,12 +24,12 @@ def createProject(project_info): Function that creates codelite projects and return the project relevant file. """ directory = project_info.info("PROJECT_PATH") - prjdir = directory + "/" + os.path.basename(directory) + prjdir = directory + os.sep + os.path.basename(directory) workspace = codeliteWorkspaceGenerator(project_info) - open(directory + "/" + os.path.basename(prjdir) + ".workspace", "w").write(workspace) + open(directory + os.sep + os.path.basename(prjdir) + ".workspace", "w").write(workspace) project = codeliteProjectGenerator(project_info) - open(directory + "/" + os.path.basename(prjdir) + ".project", "w").write(project) - return directory + "/" + os.path.basename(prjdir) + ".workspace" + open(directory + os.sep + os.path.basename(prjdir) + ".project", "w").write(project) + return directory + os.sep + os.path.basename(prjdir) + ".workspace" #### -- 2.25.1