예제 #1
0
	def add_internal_error(self, desc):
		# createAddResult ignores results (!) if they occur on empty lines.
		# Since internal errors inherently have no line to point to,
		# we need to find a good line to pass to createAddResult.
		# If we can't find a good line, fake it.
		lineNo = 0
		use_fake_lines = True

		# This is the opposite of what takes place in createAddResult
		while lineNo < 50 \
			and lineNo < len(self.textlines):

			if len(self.textlines[lineNo]) == 0:
				lineNo += 1
			else:
				use_fake_lines = False
				break

		if use_fake_lines:
			fakelines = ["                        "]
			add_result(self.results, fakelines, SEV_ERROR, 1, desc)
		else:
			add_result(self.results, self.textlines, SEV_ERROR, lineNo + 1, desc)
예제 #2
0
	def add_result(self, severity, lineNo, desc):
		add_result(self.results, self.textlines, severity, lineNo, desc)