Revision 49654212 examples/miniedit.py

View differences:

examples/miniedit.py
13 13
OpenFlow icon from https://www.opennetworking.org/
14 14
"""
15 15

  
16
# For now, tolerate long lines and long module
17
# pylint: disable=line-too-long,too-many-lines
16
# Miniedit needs some work in order to pass pylint...
17
# pylint: disable=line-too-long,too-many-lines,too-many-branches
18
# pylint: disable=too-many-statements,attribute-defined-outside-init
19
# pylint: disable=missing-docstring
18 20

  
19 21
MINIEDIT_VERSION = '2.2.0.1'
20 22

  
......
1573 1575
            self.createDataLinkBindings()
1574 1576
            self.link = self.linkWidget = None
1575 1577

  
1576
        f.close
1578
        f.close()
1577 1579

  
1578 1580
    def findWidgetByName( self, name ):
1579 1581
        for widget in self.widgetToItem:
......
2624 2626
    # Ultimately we will either want to use a topo or
2625 2627
    # mininet object here, probably.
2626 2628

  
2627
    def addLink( self, source, dest, linktype='data', linkopts={} ):
2629
    def addLink( self, source, dest, linktype='data', linkopts=None ):
2628 2630
        "Add link to model."
2631
        if linkopts is None:
2632
            linkopts = {}
2629 2633
        source.links[ dest ] = self.link
2630 2634
        dest.links[ source ] = self.link
2631 2635
        self.links[ self.link ] = {'type' :linktype,
......
3142 3146
            return
3143 3147
        self.net.nameToNode[ name ].cmd( 'iperf -s -p 5001 &' )
3144 3148

  
3145
    """ BELOW HERE IS THE TOPOLOGY IMPORT CODE """
3149
    ### BELOW HERE IS THE TOPOLOGY IMPORT CODE ###
3146 3150

  
3147 3151
    def parseArgs( self ):
3148 3152
        """Parse command-line args and return options object.
......
3562 3566
if __name__ == '__main__':
3563 3567
    setLogLevel( 'info' )
3564 3568
    app = MiniEdit()
3565
    """ import topology if specified """
3569
    ### import topology if specified ###
3566 3570
    app.parseArgs()
3567 3571
    app.importTopo()
3568 3572

  

Also available in: Unified diff