--- /dev/null
+#!/usr/bin/env python
+# encoding: utf-8
+#
+# This file is part of BeRTOS.
+#
+# Bertos is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# As a special exception, you may use this file as part of a free software
+# library without restriction. Specifically, if other files instantiate
+# templates or use macros or inline functions from this file, or you compile
+# this file and link it with other files to produce an executable, this
+# file does not by itself cause the resulting executable to be covered by
+# the GNU General Public License. This exception does not however
+# invalidate any other reasons why the executable file might be covered by
+# the GNU General Public License.
+#
+# Copyright 2010 Develer S.r.l. (http://www.develer.com/)
+#
+# $Id$
+#
+# Author: Lorenzo Berni <duplo@develer.com>
+#
+
+
+# This variable contains the wizard version. This will be stored into the
+# project files to let the Wizard know how to use them.
+# Previous versions:
+# 0 - the project file doesn't contain the version number.
+# When the current Wizard is opening project done with this version of
+# the Wizard it has to change the origina SOURCES_PATH to the local path
+# 1 - this is the current version. No special behaviours needed.
+
+
+# NOTE: Change this variable may cause the wizard to not work properly.
+WIZARD_VERSION = 1
import DefineException
import BProject
+from _wizard_version import WIZARD_VERSION
+
from LoadException import VersionException, ToolchainException
def isBertosDir(directory):
project_data = pickle.loads(open(project_file, "r").read())
project_info = BProject.BProject()
project_info.setInfo("PROJECT_PATH", os.path.dirname(project_file))
+ # Check for the Wizard version
+ wizard_version = project_data.get("WIZARD_VERSION", 0)
+ if not wizard_version:
+ project_data["SOURCES_PATH"] = os.path.dirname(project_file)
if "SOURCES_PATH" in info_dict:
project_data["SOURCES_PATH"] = info_dict["SOURCES_PATH"]
if os.path.exists(project_data["SOURCES_PATH"]):
project_data["CPU_NAME"] = project_info.info("CPU_NAME")
project_data["SELECTED_FREQ"] = project_info.info("SELECTED_FREQ")
project_data["OUTPUT"] = project_info.info("OUTPUT")
+ project_data["WIZARD_VERSION"] = WIZARD_VERSION
return pickle.dumps(project_data)
def createBertosProject(project_info, edit=False):
return name
def loadSourceTree(project):
- fileList = [f for f in os.walk(project.info("SOURCES_PATH"))]
+ # Index only the SOURCES_PATH/bertos content
+ bertos_sources_dir = os.path.join(project.info("SOURCES_PATH"), 'bertos')
+ if os.path.exists(bertos_sources_dir):
+ fileList = [f for f in os.walk(bertos_sources_dir)]
+ else:
+ fileList = []
project.setInfo("FILE_LIST", fileList)
def findDefinitions(ftype, project):