Beispiel #1
0
	def createXmlNode( self, document, recursive = True ):
		node = MApplication.createXmlNode( self, document, recursive )

		# add machine info
		for key, value  in machine_info().items():
			node.attributes[key] = value

		node.attributes["returncode"] = str( self.getReturnCode() )
		node.attributes["startTime"] = str ( formatted_time( self.__startTime ) )
		node.attributes["sys-shortname"] = self.getSystemShortName()

		return node
Beispiel #2
0
def parse_log_entry( logentry ):
	"""Parse one SVN log entry in XML format, return tuple (committer, message, revision, commitTime)"""
	revision = logentry.getAttribute( 'revision' )
	message = ''
	committer = ''
	commitTime = None

	for child in logentry.childNodes:
		if child.localName == 'author':
			committer = get_node_text( child )
		elif child.localName == 'date':
			commitTime = get_node_text( child )
		elif child.localName == 'msg':
			message = get_node_text( child ).rstrip()
		else:
			# this might be indentation whitespace
			pass

	# now turn commiTime into a Python datetime:
	timeString = commitTime.split( '.' )[0] # strip microseconds
	timeTuple = time.strptime( timeString, '%Y-%m-%dT%H:%M:%S' )
	return ( committer, message, revision, calendar.timegm( timeTuple ), formatted_time( datetime( *timeTuple[0:6] ) ) )