equal
deleted
inserted
replaced
1 # |
1 # |
2 # Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 # Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 # All rights reserved. |
3 # All rights reserved. |
4 # This component and the accompanying materials are made available |
4 # This component and the accompanying materials are made available |
5 # under the terms of the License "Eclipse Public License v1.0" |
5 # under the terms of the License "Eclipse Public License v1.0" |
6 # which accompanies this distribution, and is available |
6 # which accompanies this distribution, and is available |
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
156 return self.__SystemDefinitionFile |
156 return self.__SystemDefinitionFile |
157 |
157 |
158 def GetSystemDefinitionBase(self): |
158 def GetSystemDefinitionBase(self): |
159 return self.__SystemDefinitionBase |
159 return self.__SystemDefinitionBase |
160 |
160 |
161 def GetSystemDefinitionFile(self): |
161 def GetSystemDefinitionVersion(self): |
162 return self.__SystemDefinitionVersion |
162 return self.__SystemDefinitionVersion |
163 |
163 |
164 def GetLayerName(self): |
164 def GetLayerName(self): |
165 return self.__LayerName |
165 return self.__LayerName |
166 |
166 |
167 def GetContainerName(self, aContainerType): |
167 def GetContainerName(self, aContainerType): |
168 if self.__ContainerNames.has_key(aContainerType): |
168 if self.__ContainerNames.has_key(aContainerType): |
169 return self.__ContainerNames[aContainerType] |
169 return self.__ContainerNames[aContainerType] |
170 return "" |
170 return "" |
171 |
171 |
172 |
172 |
173 class SystemModel(object): |
173 class SystemModel(object): |
174 """A representation of the SystemModel section of a Symbian system_definition.xml file.""" |
174 """A representation of the SystemModel section of a Symbian system_definition.xml file.""" |
295 def __Parse(self): |
295 def __Parse(self): |
296 # For 2.0 and earlier: find the <systemModel> element (there can be 0 or 1) and search any <layer> elements for <unit> elements with "bldFile" attributes |
296 # For 2.0 and earlier: find the <systemModel> element (there can be 0 or 1) and search any <layer> elements for <unit> elements with "bldFile" attributes |
297 # the <layer> context of captured "bldFile" attributes is recorded as we go |
297 # the <layer> context of captured "bldFile" attributes is recorded as we go |
298 # For 3.0 and later, process any architectural topmost element, use the topmost element with an id as the "layer" |
298 # For 3.0 and later, process any architectural topmost element, use the topmost element with an id as the "layer" |
299 for child in self.__SystemDefinitionElement.childNodes: |
299 for child in self.__SystemDefinitionElement.childNodes: |
300 if child.localName == "systemModel" or child.localName == "layer" or child.localName == "package" or child.localName == "collection" or child.localName == "component": |
300 if child.localName in ["systemModel", "layer", "package", "collection", "component"]: |
301 self.__ProcessSystemModelElement(child) |
301 self.__ProcessSystemModelElement(child) |
302 |
302 |
303 def __CreateComponent(self, aBldInfFile, aUnitElement): |
303 def __CreateComponent(self, aBldInfFile, aUnitElement): |
304 # take a resolved bld.inf file and associated <unit/> element and returns a populated Component object |
304 # take a resolved bld.inf file and associated <unit/> element and returns a populated Component object |
305 containers = {} |
305 containers = {} |