pep8: Fix E127 continuation line over-indented

There are a bunch of these remaining, but I don't think the right course is
to 'fix' all of them to make pep8 happy, but instead to either change
the test in pep8 to consider that a continuation line may itself
be continued halfway, OR, to change the code in these lines to be more
readable by removing the need for all those nested continuations.

Personally, I find multiply-broken lines (aka nested continuations) really
hard to read.
This commit is contained in:
Brandon Heller
2012-11-13 17:17:51 -08:00
parent edf6003217
commit 2e089b5e4a
6 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -19,10 +19,10 @@ class SingleSwitchTopo(Topo):
for h in range(n):
# Each host gets 50%/n of system CPU
host = self.addHost('h%s' % (h + 1),
cpu=.5 / n)
cpu=.5 / n)
# 10 Mbps, 5ms delay, 10% loss
self.addLink(host, switch,
bw=10, delay='5ms', loss=10, use_htb=True)
bw=10, delay='5ms', loss=10, use_htb=True)
def perfTest():
"Create network and run simple performance test"
+3 -3
View File
@@ -10,9 +10,9 @@ def treePing64():
"Run ping test on 64-node tree networks."
results = {}
switches = { # 'reference kernel': KernelSwitch,
'reference user': UserSwitch,
'Open vSwitch kernel': OVSKernelSwitch }
switches = { # 'reference kernel': KernelSwitch,
'reference user': UserSwitch,
'Open vSwitch kernel': OVSKernelSwitch }
for name in switches:
print "*** Testing", name, "datapath"
+4 -4
View File
@@ -246,11 +246,11 @@ class TCIntf( Intf ):
'%s ' % jitter if jitter is not None else '',
'loss %d ' % loss if loss is not None else '',
'limit %d' % max_queue_size if max_queue_size is not None
else '' )
else '' )
if netemargs:
cmds = [ '%s qdisc add dev %s ' + parent +
' handle 10: netem ' +
netemargs ]
netemargs ]
return cmds
def tc( self, cmd, tc='tc' ):
@@ -290,8 +290,8 @@ class TCIntf( Intf ):
# Delay/jitter/loss/max_queue_size using netem
cmds += self.delayCmds( delay=delay, jitter=jitter, loss=loss,
max_queue_size=max_queue_size,
parent=parent )
max_queue_size=max_queue_size,
parent=parent )
# Ugly but functional: display configuration info
stuff = ( ( [ '%.2fMbit' % bw ] if bw is not None else [] ) +
+1 -1
View File
@@ -423,7 +423,7 @@ class Mininet( object ):
m = re.search( r, pingOutput )
if m is None:
error( '*** Error: could not parse ping output: %s\n' %
pingOutput )
pingOutput )
return (1, 0)
sent, received = int( m.group( 1 ) ), int( m.group( 2 ) )
return sent, received
+3 -3
View File
@@ -770,7 +770,7 @@ class Switch( Node ):
return Node.sendCmd( self, *cmd, **kwargs )
else:
error( '*** Error: %s has execed and cannot accept commands' %
self.name )
self.name )
def __repr__( self ):
"More informative string representation"
@@ -1053,7 +1053,7 @@ class NOX( Controller ):
Controller.__init__( self, name,
command=noxCoreDir + '/nox_core',
cargs='--libdir=/usr/local/lib -v -i ptcp:%s ' +
' '.join( noxArgs ),
' '.join( noxArgs ),
cdir=noxCoreDir,
**kwargs )
@@ -1084,4 +1084,4 @@ class RemoteController( Controller ):
( self.ip, self.port ) )
if 'Unable' in listening:
warn( "Unable to contact the remote controller"
" at %s:%d\n" % ( self.ip, self.port ) )
" at %s:%d\n" % ( self.ip, self.port ) )
+2 -2
View File
@@ -63,7 +63,7 @@ class Topo(object):
return result
def addLink(self, node1, node2, port1=None, port2=None,
**opts):
**opts):
"""node1, node2: nodes to link together
port1, port2: ports (optional)
opts: link options (optional)
@@ -205,7 +205,7 @@ class SingleSwitchReversedTopo(Topo):
for h in irange(1, k):
host = self.addHost('h%s' % h)
self.addLink(host, switch,
port1=0, port2=(k - h + 1))
port1=0, port2=(k - h + 1))
class LinearTopo(Topo):
"Linear topology of k switches, with one host per switch."