Пример #1
0
	def createEdge(self, nodeSrc, nodeDest):
		#found a nodeDest in the NodeSrc Edge list
		#change line to convergence, match correctly (solid)
		notfound = True
		if nodeSrc.myEdges.has_key(nodeDest.label):
			edge = nodeSrc.myEdges[nodeDest.label]
			if edge.type == 'dotted' or edge.type == 'solid':
				edge.type = 'solid'
				notfound = False

		#else,  artifact call were not specified on the conceptual architecture
		#change line to divergence (dashed)
		if notfound:
			nodeSrc.addEdge(pEdge(nodeDest, 'dashed'))
		return
Пример #2
0
 def parseEdgesFromFile( self, filename ):
 	if self.verbose: print 'parsing edges from : %s' %(filename) 
     f = self.openFile(filename)
     if f is not None:
     	#For each line of file
     	for line in f.readlines():
     		#parseEdgeLine()
     		currentEdge = self.parseEdgeLine(line)
     		#print currentEdge
     		#if list is not empty
     		if(currentEdge and len(currentEdge) >= 2):
     			#Find Destinantion Node that match label
     			if(currentEdge[0] in self.parsedNodes and currentEdge[1] in self.parsedNodes):
     				#Add Edge and Type to origin Node if destination and origin node
     				#were found in parsedNodes
     				self.parsedNodes[currentEdge[0]].addEdge(pEdge(self.parsedNodes[currentEdge[1]]))
     			else:
     				if self.verbose: print "Found an Edge for Nodes that do not exist, ignoring..."