sbsv2/raptor/python/raptor_meta.py
branchwip
changeset 29 ee00c00df073
parent 14 45cdac6e50c6
child 32 fdfc59a2ae7e
equal deleted inserted replaced
28:6983dbbe3d70 29:ee00c00df073
  2650 	def ModuleName(self,aBldInfPath):
  2650 	def ModuleName(self,aBldInfPath):
  2651 		"""Calculate the name of the ROM/emulator batch files that run the tests"""
  2651 		"""Calculate the name of the ROM/emulator batch files that run the tests"""
  2652 
  2652 
  2653 		def LeftPortionOf(pth,sep):
  2653 		def LeftPortionOf(pth,sep):
  2654 			""" Internal function to return portion of str that is to the left of sep. 
  2654 			""" Internal function to return portion of str that is to the left of sep. 
  2655 			The partition is case-insentive."""
  2655 			The split is case-insensitive."""
  2656 			length = len((pth.lower().partition(sep.lower()))[0])
  2656 			length = len((pth.lower().split(sep.lower()))[0])
  2657 			return pth[0:length]
  2657 			return pth[0:length]
  2658 			
  2658 			
  2659 		modulePath = LeftPortionOf(LeftPortionOf(os.path.dirname(aBldInfPath), "group"), "ongoing")
  2659 		modulePath = LeftPortionOf(LeftPortionOf(os.path.dirname(aBldInfPath), "group"), "ongoing")
  2660 		moduleName = os.path.basename(modulePath.strip("/"))
  2660 		moduleName = os.path.basename(modulePath.strip("/"))
  2661 		
  2661 		
  2928 						if os.path.exists(expfilename):
  2928 						if os.path.exists(expfilename):
  2929 							os.chmod(expfilename,stat.S_IREAD | stat.S_IWRITE)
  2929 							os.chmod(expfilename,stat.S_IREAD | stat.S_IWRITE)
  2930 						expfile = open(expfilename, 'wb')
  2930 						expfile = open(expfilename, 'wb')
  2931 						expfile.write(exportzip.read(file))
  2931 						expfile.write(exportzip.read(file))
  2932 						expfile.close()
  2932 						expfile.close()
       
  2933 						
       
  2934 						# Resurrect any file execution permissions present in the archived version
       
  2935 						if (exportzip.getinfo(file).external_attr >> 16L) & 0100:
       
  2936 							os.chmod(expfilename, stat.S_IMODE(os.stat(expfilename).st_mode) | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)						
       
  2937 						
  2933 						# Each file keeps its modified time the same as what it was before unzipping
  2938 						# Each file keeps its modified time the same as what it was before unzipping
  2934 						accesstime = time.time()
  2939 						accesstime = time.time()
  2935 						datetime = exportzip.getinfo(file).date_time
  2940 						datetime = exportzip.getinfo(file).date_time
  2936 						timeTuple=(int(datetime[0]), int(datetime[1]), int(datetime[2]), int(datetime[3]), \
  2941 						timeTuple=(int(datetime[0]), int(datetime[1]), int(datetime[2]), int(datetime[3]), \
  2937 									int(datetime[4]), int(datetime[5]), int(0), int(0), int(0))
  2942 									int(datetime[4]), int(datetime[5]), int(0), int(0), int(0))