From 17c1195c6f3579b1f6600c9a9735c7729ae27ecc Mon Sep 17 00:00:00 2001 From: duplo Date: Thu, 2 Apr 2009 12:55:32 +0000 Subject: [PATCH] Create the wizard plugins infrastructure git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2467 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos_utils.py | 7 ++----- wizard/plugins/__init__.py | 10 ++++++++++ wizard/{ => plugins}/codelite_project.py | 11 +++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 wizard/plugins/__init__.py rename wizard/{ => plugins}/codelite_project.py (82%) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index dd876c28..1b8715ff 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -17,7 +17,7 @@ import shutil import pickle import const -import codelite_project +from plugins import codelite_project import DefineException def isBertosDir(directory): @@ -77,10 +77,7 @@ def createBertosProject(project_info): open(prjdir + "/main.c", "w").write(main) ## Codelite project files if "codelite" in project_info.info("OUTPUT"): - workspace = codelite_project.codeliteWorkspaceGenerator(project_info) - open(directory + "/" + os.path.basename(prjdir) + ".workspace", "w").write(workspace) - project = codelite_project.codeliteProjectGenerator(project_info) - open(directory + "/" + os.path.basename(prjdir) + ".project", "w").write(project) + codelite_project.createProject(project_info) def mkGenerator(project_info, makefile): """ diff --git a/wizard/plugins/__init__.py b/wizard/plugins/__init__.py new file mode 100644 index 00000000..0174745c --- /dev/null +++ b/wizard/plugins/__init__.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +# encoding: utf-8 +# +# Copyright 2009 Develer S.r.l. (http://www.develer.com/) +# All rights reserved. +# +# $Id:$ +# +# Author: Lorenzo Berni +# \ No newline at end of file diff --git a/wizard/codelite_project.py b/wizard/plugins/codelite_project.py similarity index 82% rename from wizard/codelite_project.py rename to wizard/plugins/codelite_project.py index a8739d0a..c55c7dc4 100644 --- a/wizard/codelite_project.py +++ b/wizard/plugins/codelite_project.py @@ -66,3 +66,14 @@ def codeliteWorkspaceGenerator(project_info): while template.find("$project") != -1: template = template.replace("$project", project_name) return template + +def createProject(project_info): + """ + Function that creates codelite projects. + """ + directory = project_info.info("PROJECT_PATH") + prjdir = directory + "/" + os.path.basename(directory) + workspace = codeliteWorkspaceGenerator(project_info) + open(directory + "/" + os.path.basename(prjdir) + ".workspace", "w").write(workspace) + project = codeliteProjectGenerator(project_info) + open(directory + "/" + os.path.basename(prjdir) + ".project", "w").write(project) -- 2.25.1