Commit 1d8ad749 authored by Gino Tosti's avatar Gino Tosti
Browse files

code cleaning and added possibility to do cdbChecker after a build

parent 687515f5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ def setCDBEnvVar(dirname):
	pwd = os.getcwd()
	os.chdir(dirname)
	f=open("setCDB.sh","w")
	f.write("export ACS_CDB="+os.path.abspath(dirname)+"\n")
	f.write("export ACS_CDB="+dirname+"\n")
	f.close()
	os.chdir(pwd)
	return
+23 −4
Original line number Diff line number Diff line
@@ -27,29 +27,32 @@ def generateComponent(config,install=False):
	wb=excelIcd(config['icdfile'])
	smain= wb.book.parse("Main")
	devs= smain['Device Name']
	comp=smain['Component Name']
	#comp=smain['Component Name']
	assembly=smain['Assembly']
	outfile=[]
	#outfile=[]
	if len(devs)>1 :
		print ("the Assembly:"+assembly[0]+" includes more than one device\n",devs)
		for dev in devs:
			print("working On device:", dev)
			outf=manageICDFiles(dev,outdir,wb)
			outfile.append(outf)
			#outfile.append(outf)
			print("Working on files:",dev)
			wb1=excelIcd(ouf)
			wb1=excelIcd(outf)
			mygen=genFromTemplates(wb1,outf,config['prefix'],config['module'],config['basedir'])
			mygen.generateFileInDir()
			if install :
				build(mygen)
				
		removetmpfiles()			   
	else:
		print ("the Assembly:"+assembly[0]+" includes one device\n",devs)
		#outf=manageICDFiles(devs[0],outdir,wb)
		mygen=genFromTemplates(wb,config['icdfile'],config['prefix'],config['module'],config['basedir'])
		mygen.generateFileInDir()
		checkCDB(mygen)
		if install :
			build(mygen)
			checkCDB(mygen)
	os.chdir(pwd)

def manageICDFiles(dev,outdir,wb):
@@ -80,7 +83,23 @@ def build(mygen):
	     print ("Executing:",command,'\n',"...Please wait it will take some minutes")
	     if execACSCommand(command):
	        print ("ERROR executing: ",command)
	        return
	     os.chdir(pwd)
	     checkCDB(mygen)
	  return

def checkCDB(mygen):
	pwd=os.getcwd()
	#os.chdir(mygen._dirs['test'])
	print ("Check CDB in", os.getcwd())
	command="./setCDB.sh ; cdbChecker"
	print ("Executing:",command,'\n',"...Please wait....")
	if execACSCommand(command):
		print ("ERROR executing: ",command)
		return
	
	os.chdir(pwd)
	return

def removetmpfiles():