sbsv2/raptor/python/raptor_meta.py
branchwip
changeset 32 fdfc59a2ae7e
parent 29 ee00c00df073
child 44 cf0c187b284a
child 48 f872a2538607
equal deleted inserted replaced
31:c7bbe0e983d3 32:fdfc59a2ae7e
   295 		self.raptor = aRaptor
   295 		self.raptor = aRaptor
   296 
   296 
   297 	def call(self, aArgs, sourcefilename):
   297 	def call(self, aArgs, sourcefilename):
   298 		""" Override call so that we can do our own error handling."""
   298 		""" Override call so that we can do our own error handling."""
   299 		tool = self._ExternalTool__Tool
   299 		tool = self._ExternalTool__Tool
       
   300 		commandline = tool + " " + aArgs + " " + str(sourcefilename)
   300 		try:
   301 		try:
   301 			commandline = tool + " " + aArgs + " " + str(sourcefilename)
       
   302 
       
   303 			# the actual call differs between Windows and Unix
   302 			# the actual call differs between Windows and Unix
   304 			if raptor_utilities.getOSFileSystem() == "unix":
   303 			if raptor_utilities.getOSFileSystem() == "unix":
   305 				p = subprocess.Popen(commandline, \
   304 				p = subprocess.Popen(commandline, \
   306 									 shell=True, bufsize=65535, \
   305 									 shell=True, bufsize=65535, \
   307 									 stdin=subprocess.PIPE, \
   306 									 stdin=subprocess.PIPE, \
   343 							actualErr = True
   342 							actualErr = True
   344 			if actualErr:
   343 			if actualErr:
   345 				raise MetaDataError("Errors in %s" % str(sourcefilename))
   344 				raise MetaDataError("Errors in %s" % str(sourcefilename))
   346 
   345 
   347 		except Exception,e:
   346 		except Exception,e:
   348 			raise MetaDataError("Preprocessor exception: %s" % str(e))
   347 			raise MetaDataError("Preprocessor exception: '%s' : in command : '%s'" % (str(e), commandline))
   349 
   348 
   350 		return 0	# all OK
   349 		return 0	# all OK
   351 
   350 
   352 	def setMacros(self, aMacros):
   351 	def setMacros(self, aMacros):
   353 		self.__Macros = aMacros
   352 		self.__Macros = aMacros