Skip to content

Commit 2e089b5

Browse files
author
Brandon Heller
committed
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.
1 parent edf6003 commit 2e089b5

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

examples/simpleperf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def __init__(self, n=2, **opts):
1919
for h in range(n):
2020
# Each host gets 50%/n of system CPU
2121
host = self.addHost('h%s' % (h + 1),
22-
cpu=.5 / n)
22+
cpu=.5 / n)
2323
# 10 Mbps, 5ms delay, 10% loss
2424
self.addLink(host, switch,
25-
bw=10, delay='5ms', loss=10, use_htb=True)
25+
bw=10, delay='5ms', loss=10, use_htb=True)
2626

2727
def perfTest():
2828
"Create network and run simple performance test"

examples/treeping64.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ def treePing64():
1010
"Run ping test on 64-node tree networks."
1111

1212
results = {}
13-
switches = { # 'reference kernel': KernelSwitch,
14-
'reference user': UserSwitch,
15-
'Open vSwitch kernel': OVSKernelSwitch }
13+
switches = { # 'reference kernel': KernelSwitch,
14+
'reference user': UserSwitch,
15+
'Open vSwitch kernel': OVSKernelSwitch }
1616

1717
for name in switches:
1818
print "*** Testing", name, "datapath"

mininet/link.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,11 @@ def delayCmds( parent, delay=None, jitter=None,
246246
'%s ' % jitter if jitter is not None else '',
247247
'loss %d ' % loss if loss is not None else '',
248248
'limit %d' % max_queue_size if max_queue_size is not None
249-
else '' )
249+
else '' )
250250
if netemargs:
251251
cmds = [ '%s qdisc add dev %s ' + parent +
252252
' handle 10: netem ' +
253-
netemargs ]
253+
netemargs ]
254254
return cmds
255255

256256
def tc( self, cmd, tc='tc' ):
@@ -290,8 +290,8 @@ def config( self, bw=None, delay=None, jitter=None, loss=None,
290290

291291
# Delay/jitter/loss/max_queue_size using netem
292292
cmds += self.delayCmds( delay=delay, jitter=jitter, loss=loss,
293-
max_queue_size=max_queue_size,
294-
parent=parent )
293+
max_queue_size=max_queue_size,
294+
parent=parent )
295295

296296
# Ugly but functional: display configuration info
297297
stuff = ( ( [ '%.2fMbit' % bw ] if bw is not None else [] ) +

mininet/net.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def _parsePing( pingOutput ):
423423
m = re.search( r, pingOutput )
424424
if m is None:
425425
error( '*** Error: could not parse ping output: %s\n' %
426-
pingOutput )
426+
pingOutput )
427427
return (1, 0)
428428
sent, received = int( m.group( 1 ) ), int( m.group( 2 ) )
429429
return sent, received

mininet/node.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ def sendCmd( self, *cmd, **kwargs ):
770770
return Node.sendCmd( self, *cmd, **kwargs )
771771
else:
772772
error( '*** Error: %s has execed and cannot accept commands' %
773-
self.name )
773+
self.name )
774774

775775
def __repr__( self ):
776776
"More informative string representation"
@@ -1053,7 +1053,7 @@ def __init__( self, name, *noxArgs, **kwargs ):
10531053
Controller.__init__( self, name,
10541054
command=noxCoreDir + '/nox_core',
10551055
cargs='--libdir=/usr/local/lib -v -i ptcp:%s ' +
1056-
' '.join( noxArgs ),
1056+
' '.join( noxArgs ),
10571057
cdir=noxCoreDir,
10581058
**kwargs )
10591059

@@ -1084,4 +1084,4 @@ def checkListening( self ):
10841084
( self.ip, self.port ) )
10851085
if 'Unable' in listening:
10861086
warn( "Unable to contact the remote controller"
1087-
" at %s:%d\n" % ( self.ip, self.port ) )
1087+
" at %s:%d\n" % ( self.ip, self.port ) )

mininet/topo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def addSwitch(self, name, **opts):
6363
return result
6464

6565
def addLink(self, node1, node2, port1=None, port2=None,
66-
**opts):
66+
**opts):
6767
"""node1, node2: nodes to link together
6868
port1, port2: ports (optional)
6969
opts: link options (optional)
@@ -205,7 +205,7 @@ def __init__(self, k=2, **opts):
205205
for h in irange(1, k):
206206
host = self.addHost('h%s' % h)
207207
self.addLink(host, switch,
208-
port1=0, port2=(k - h + 1))
208+
port1=0, port2=(k - h + 1))
209209

210210
class LinearTopo(Topo):
211211
"Linear topology of k switches, with one host per switch."

0 commit comments

Comments
 (0)