Revision 0774c8bb

View differences:

mininet/topo.py
93 93

  
94 94
        '''
95 95
        self.g = Graph()
96
        self.node_info = {} # dpids hash to Node objects
97
        self.edge_info = {} # (src_dpid, dst_dpid) tuples hash to Edge objects
98
        self.ports = {} # ports[src][dst] is port on src that connects to dst
99
        self.id_gen = NodeID # class used to generate dpid
96
        self.node_info = {}  # dpids hash to Node objects
97
        self.edge_info = {}  # (src_dpid, dst_dpid) tuples hash to Edge objects
98
        self.ports = {}  # ports[src][dst] is port on src that connects to dst
99
        self.id_gen = NodeID  # class used to generate dpid
100 100

  
101 101
    def add_node(self, dpid, node):
102 102
        '''Add Node to graph.
......
130 130
        if src not in self.ports:
131 131
            self.ports[src] = {}
132 132
        if dst not in self.ports[src]:
133
            self.ports[src][dst] = len(self.ports[src]) # num outlinks
133
            self.ports[src][dst] = len(self.ports[src])  # num outlinks
134 134

  
135 135
        if dst not in self.ports:
136 136
            self.ports[dst] = {}
137 137
        if src not in self.ports[dst]:
138
            self.ports[dst][src] = len(self.ports[dst]) # num outlinks
138
            self.ports[dst][src] = len(self.ports[dst])  # num outlinks
139 139

  
140 140
    def node_enabled(self, dpid):
141 141
        '''Is node connected, admin on, powered on, and fault-free?

Also available in: Unified diff