Revision 3e1100b7 mininet/topo.py

View differences:

mininet/topo.py
23 23
    def add_node( self, node, attr_dict=None, **attrs):
24 24
        """Add node to graph
25 25
           attr_dict: attribute dict (optional)
26
           attrs: more attributes (optional)"""
26
           attrs: more attributes (optional)
27
           warning: updates attr_dict with attrs"""
27 28
        attr_dict = {} if attr_dict is None else attr_dict
28 29
        attr_dict.update( attrs )
29 30
        self.node[ node ] = attr_dict
......
31 32
    def add_edge( self, src, dst, key=None, attr_dict=None, **attrs ):
32 33
        """Add edge to graph
33 34
           key: optional key
34
           attr_dict: optional attribute dict"""
35
           attr_dict: optional attribute dict
36
           attrs: more attributes
37
           warning: udpates attr_dict with attrs"""
35 38
        attr_dict = {} if attr_dict is None else attr_dict
36 39
        attr_dict.update( attrs )
37 40
        self.node.setdefault( src, {} )
......
151 154
        if not opts and self.lopts:
152 155
            opts = self.lopts
153 156
        port1, port2 = self.addPort( node1, node2, port1, port2 )
157
        opts = dict( opts )
154 158
        opts.update( node1=node1, node2=node2, port1=port1, port2=port2 )
155 159
        self.g.add_edge(node1, node2, key, opts )
156 160
        return key

Also available in: Unified diff