Changeset 3351

Show
Ignore:
Timestamp:
04/07/07 16:42:59 (6 years ago)
Author:
jgaeddert
Message:

adding port types to xml testing

Location:
experimental/python_parser
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • experimental/python_parser/amara_parser.py

    r3349 r3351  
    3636                tmpName = p.providesname 
    3737                tmpInt = getInterface(p.repid,tmpName) 
    38                 print "  provides port : " + tmpName + " (" + tmpInt + ")" 
    3938                if tmpInt == None: 
    4039                    return None 
    4140                tmpType = p.porttype.type 
     41                print "  provides port : " + tmpName + " (" + tmpInt + ") - " + tmpType 
    4242                #newPort = CC.Port(tmpName,tmpInt,type='Provides',portType=tmpType) 
    4343                #newComp.ports.append(newPort) 
     
    4747                tmpName = p.usesname 
    4848                tmpInt = getInterface(p.repid,tmpName) 
    49                 print "  uses port : " + tmpName + " (" + tmpInt + ")" 
    5049                if tmpInt == None: 
    5150                    return None 
     51                print "  uses port : " + tmpName + " (" + tmpInt + ") - " + tmpType 
    5252                tmpType = p.porttype.type 
    5353                #newPort = CC.Port(tmpName,tmpInt,type='Uses',portType=tmpType) 
  • experimental/python_parser/python_parser.py

    r3349 r3351  
    4141        tmpName = node.getAttribute("providesname") 
    4242        tmpInt = getInterface( node.getAttribute("repid"), tmpName ) 
    43         print "  provides port : " + tmpName + " (" + tmpInt + ")" 
     43        portTypeNodeList = node.getElementsByTagName("porttype") 
     44        tmpType = portTypeNodeList[0].getAttribute("type") 
     45        print "  provides port : " + tmpName + " (" + tmpInt + ") - " + tmpType 
    4446    for node in usesPortsNodes: 
    4547        tmpName = node.getAttribute("usesname") 
    4648        tmpInt = getInterface( node.getAttribute("repid"), tmpName ) 
    47         print "  provides port : " + tmpName + " (" + tmpInt + ")" 
     49        portTypeNodeList = node.getElementsByTagName("porttype") 
     50        tmpType = portTypeNodeList[0].getAttribute("type") 
     51        print "  uses port : " + tmpName + " (" + tmpInt + ") - " + tmpType 
    4852 
    4953if __name__ == '__main__':