Pass codecheck.
This commit is contained in:
@@ -77,7 +77,8 @@ class Console( Frame ):
|
|||||||
**self.buttonStyle )
|
**self.buttonStyle )
|
||||||
label.pack( side='top', fill='x' )
|
label.pack( side='top', fill='x' )
|
||||||
text = Text( self, wrap='word', **self.textStyle )
|
text = Text( self, wrap='word', **self.textStyle )
|
||||||
ybar = Scrollbar( self, orient='vertical', width=7, command=text.yview )
|
ybar = Scrollbar( self, orient='vertical', width=7,
|
||||||
|
command=text.yview )
|
||||||
text.configure( yscrollcommand=ybar.set )
|
text.configure( yscrollcommand=ybar.set )
|
||||||
text.pack( side='left', expand=True, fill='both' )
|
text.pack( side='left', expand=True, fill='both' )
|
||||||
ybar.pack( side='right', fill='y' )
|
ybar.pack( side='right', fill='y' )
|
||||||
|
|||||||
@@ -176,7 +176,8 @@ class MiniEdit( Frame ):
|
|||||||
"Update canvas scroll region to hold everything."
|
"Update canvas scroll region to hold everything."
|
||||||
bbox = self.canvas.bbox( 'all' )
|
bbox = self.canvas.bbox( 'all' )
|
||||||
if bbox is not None:
|
if bbox is not None:
|
||||||
self.canvas.configure( scrollregion=( 0, 0, bbox[ 2 ], bbox[ 3 ] ) )
|
self.canvas.configure( scrollregion=( 0, 0, bbox[ 2 ],
|
||||||
|
bbox[ 3 ] ) )
|
||||||
|
|
||||||
def canvasx( self, x_root ):
|
def canvasx( self, x_root ):
|
||||||
"Convert root x coordinate to canvas coordinate."
|
"Convert root x coordinate to canvas coordinate."
|
||||||
@@ -449,21 +450,26 @@ class MiniEdit( Frame ):
|
|||||||
self.linkx, self.linky = x, y
|
self.linkx, self.linky = x, y
|
||||||
self.linkWidget = w
|
self.linkWidget = w
|
||||||
self.linkItem = item
|
self.linkItem = item
|
||||||
|
|
||||||
# Link bindings
|
# Link bindings
|
||||||
# Selection still needs a bit of work overall
|
# Selection still needs a bit of work overall
|
||||||
# Callbacks ignore event
|
# Callbacks ignore event
|
||||||
# pylint: disable-msg=W0613
|
# pylint: disable-msg=W0613
|
||||||
|
|
||||||
def select( event, link=self.link ):
|
def select( event, link=self.link ):
|
||||||
"Select item on mouse entry."
|
"Select item on mouse entry."
|
||||||
self.selectItem( link )
|
self.selectItem( link )
|
||||||
|
|
||||||
def highlight( event, link=self.link ):
|
def highlight( event, link=self.link ):
|
||||||
"Highlight item on mouse entry."
|
"Highlight item on mouse entry."
|
||||||
# self.selectItem( link )
|
# self.selectItem( link )
|
||||||
self.canvas.itemconfig( link, fill='green' )
|
self.canvas.itemconfig( link, fill='green' )
|
||||||
|
|
||||||
def unhighlight( event, link=self.link ):
|
def unhighlight( event, link=self.link ):
|
||||||
"Unhighlight item on mouse exit."
|
"Unhighlight item on mouse exit."
|
||||||
self.canvas.itemconfig( link, fill='blue' )
|
self.canvas.itemconfig( link, fill='blue' )
|
||||||
# self.selectItem( None )
|
# self.selectItem( None )
|
||||||
|
|
||||||
# pylint: disable-msg=W0613
|
# pylint: disable-msg=W0613
|
||||||
self.canvas.tag_bind( self.link, '<Enter>', highlight )
|
self.canvas.tag_bind( self.link, '<Enter>', highlight )
|
||||||
self.canvas.tag_bind( self.link, '<Leave>', unhighlight )
|
self.canvas.tag_bind( self.link, '<Leave>', unhighlight )
|
||||||
@@ -520,7 +526,6 @@ class MiniEdit( Frame ):
|
|||||||
# Show (existing) window
|
# Show (existing) window
|
||||||
about.deiconify()
|
about.deiconify()
|
||||||
|
|
||||||
|
|
||||||
def createToolImages( self ):
|
def createToolImages( self ):
|
||||||
"Create toolbar (and icon) images."
|
"Create toolbar (and icon) images."
|
||||||
|
|
||||||
@@ -706,7 +711,3 @@ if __name__ == '__main__':
|
|||||||
setLogLevel( 'info' )
|
setLogLevel( 'info' )
|
||||||
app = MiniEdit()
|
app = MiniEdit()
|
||||||
app.mainloop()
|
app.mainloop()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,4 +16,3 @@ if __name__ == '__main__':
|
|||||||
setLogLevel( 'info' )
|
setLogLevel( 'info' )
|
||||||
network = TreeNet( depth=2, fanout=32, switch=KernelSwitch )
|
network = TreeNet( depth=2, fanout=32, switch=KernelSwitch )
|
||||||
network.run( CLI, network )
|
network.run( CLI, network )
|
||||||
|
|
||||||
|
|||||||
@@ -252,7 +252,8 @@ class UdpBwTest( Frame ):
|
|||||||
seconds, inbw, outbw = parsebwtest( line )
|
seconds, inbw, outbw = parsebwtest( line )
|
||||||
if seconds is None:
|
if seconds is None:
|
||||||
break
|
break
|
||||||
result = self.results.get( seconds, [] ) + [ ( host, inbw, outbw ) ]
|
result = self.results.get( seconds, [] ) + [
|
||||||
|
( host, inbw, outbw ) ]
|
||||||
self.results[ seconds ] = result
|
self.results[ seconds ] = result
|
||||||
if len( result ) == self.hostCount:
|
if len( result ) == self.hostCount:
|
||||||
# Calculate total and update graph
|
# Calculate total and update graph
|
||||||
@@ -306,5 +307,3 @@ if __name__ == '__main__':
|
|||||||
setLogLevel( 'info' )
|
setLogLevel( 'info' )
|
||||||
app = UdpBwTest( topo=TreeTopo( depth=2, fanout=2 ) )
|
app = UdpBwTest( topo=TreeTopo( depth=2, fanout=2 ) )
|
||||||
app.mainloop()
|
app.mainloop()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,4 +52,3 @@ def cleanup():
|
|||||||
sh( "ip link del " + link )
|
sh( "ip link del " + link )
|
||||||
|
|
||||||
info( "*** Cleanup complete.\n" )
|
info( "*** Cleanup complete.\n" )
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,6 @@ class Mininet( object ):
|
|||||||
if topo and build:
|
if topo and build:
|
||||||
self.build()
|
self.build()
|
||||||
|
|
||||||
|
|
||||||
def addHost( self, name, mac=None, ip=None ):
|
def addHost( self, name, mac=None, ip=None ):
|
||||||
"""Add host.
|
"""Add host.
|
||||||
name: name of host to add
|
name: name of host to add
|
||||||
|
|||||||
@@ -58,4 +58,3 @@ def makeTerms( nodes, title='Node', term='xterm' ):
|
|||||||
title: base title for each
|
title: base title for each
|
||||||
returns: list of created terminal processes"""
|
returns: list of created terminal processes"""
|
||||||
return [ makeTerm( node, title, term ) for node in nodes ]
|
return [ makeTerm( node, title, term ) for node in nodes ]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user