38""" Create from a config element a list of parent
+ 39 that are abstract (not buildable).
+ 40 """
+ 41result=[]
+ 42while(config.parent!=None):
+ 43ifconfig.parent.abstract!=None:
+ 44result.append(config.parent)
+ 45config=config.parent
+ 46returnresult
+
99""" Generates a mytraces.txt file under \epoc32 based on the <mytraces/>
+100 XML sub-elements defined for the image.
+101 """
+102sys.stdout.flush()
+103ifconfig.has_key('mytraces.binaries')andlen(str(config['mytraces.binaries']))>0:
+104mytracestxt=escape_string(config['mytraces.file'],config)
+105logger.debug("Writing %s file"%mytracestxt)
+106binaries=config['mytraces.binaries']
+107traces_file=open(mytracestxt,'w')
+108forbinaryinbinaries:
+109traces_file.write(str(binary)+"\n")
+110traces_file.close()
+
241""" Creates the destination directory of the ROM files if it does not exist.
+242 """
+243dest=self.config['rom.output.dir']
+244ifnotos.path.exists(dest):
+245os.makedirs(dest)
+
248""" Copies the CMT image under \epoc32 and to the destination directory of
+249 the ROM image, if the image will include the CMT.
+250 """
+251# Check if a CMT is needed
+252ifself.config['image.nocmt']!='true':
+253dest=self.config['rom.output.dir']
+254logger.debug("Copying "+self.config['cmt']+" to "+dest)
+255shutil.copy(self.config['cmt'],dest)
+256logger.debug("Copying "+self.config['cmt']+" to "+self.config['rommake.cmt.path'])
+257shutil.copy(self.config['cmt'],self.config['rommake.cmt.path'])
+
260""" Generates the version text files that define the version of the ROM image.
+261 These are in UTF16 little endian (Symbian) format.
+262 """
+263Version('sw',self.config).write()
+264Version('langsw',self.config).write()
+265Version('model',self.config).write()
+
268""" Generates a mytraces.txt file under \epoc32 based on the <mytraces/>
+269 XML sub-elements defined for the image.
+270 """
+271sys.stdout.flush()
+272ifself.config.has_key('mytraces.binaries'):
+273logger.debug("Writing mytraces.txt file")
+274binaries=self.config['mytraces.binaries']
+275traces_file=open(str(self.config['rommake.mytraces.file']),'w')
+276forbinaryinbinaries:
+277traces_file.write(str(binary)+"\n")
+278traces_file.close()
+279else:
+280self._clean_mytraces()
+
335""" Returns the filename of the image file once copied to the
+336 \*_flash_images directory.
+337 """
+338# Get the unique build ID for these ROM image names
+339name=str(self.config['rom.id'])+'_'+self.config['image.type']
+340
+341# Add a flag if the ROM is textshell
+342ifself.config['image.ui']=='text':
+343name+="_text"
+344
+345# Add a flag if the image does not a CMT
+346ifself.config['image.nocmt']=='true':
+347name+="_nocmt"
+348
+349# Add any differentiating name extension if present3
+350ifself.config['image.name.extension']!='':
+351name+='_'+self.config['image.name.extension']
+352
+353returnname
+