Pass code check.
This commit is contained in:
@@ -53,7 +53,7 @@ disable-msg-cat=IR
|
|||||||
#enable-msg=
|
#enable-msg=
|
||||||
|
|
||||||
# Disable the message(s) with the given id(s).
|
# Disable the message(s) with the given id(s).
|
||||||
disable-msg=W0704,C0103,W0231,E1102,W0511,W0142,R0902,R0903,R0904,R0913,R0914,R0801
|
disable=W0704,C0103,W0231,E1102,W0511,W0142,R0902,R0903,R0904,R0913,R0914,R0801,I0011
|
||||||
|
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ class MiniEdit( Frame ):
|
|||||||
cleanUpScreens()
|
cleanUpScreens()
|
||||||
self.net = None
|
self.net = None
|
||||||
|
|
||||||
def xterm( self, ignore=None ):
|
def xterm( self, _ignore=None ):
|
||||||
"Make an xterm when a button is pressed."
|
"Make an xterm when a button is pressed."
|
||||||
if ( self.selection is None or
|
if ( self.selection is None or
|
||||||
self.net is None or
|
self.net is None or
|
||||||
|
|||||||
+7
-7
@@ -116,19 +116,19 @@ class Node( object ):
|
|||||||
self.shell = None
|
self.shell = None
|
||||||
|
|
||||||
# Subshell I/O, commands and control
|
# Subshell I/O, commands and control
|
||||||
def read( self, bytes=1024 ):
|
def read( self, maxbytes=1024 ):
|
||||||
"""Buffered read from node, non-blocking.
|
"""Buffered read from node, non-blocking.
|
||||||
bytes: maximum number of bytes to return"""
|
maxbytes: maximum number of bytes to return"""
|
||||||
count = len( self.readbuf )
|
count = len( self.readbuf )
|
||||||
if count < bytes:
|
if count < maxbytes:
|
||||||
data = os.read( self.stdout.fileno(), bytes - count )
|
data = os.read( self.stdout.fileno(), maxbytes - count )
|
||||||
self.readbuf += data
|
self.readbuf += data
|
||||||
if bytes >= len( self.readbuf ):
|
if maxbytes >= len( self.readbuf ):
|
||||||
result = self.readbuf
|
result = self.readbuf
|
||||||
self.readbuf = ''
|
self.readbuf = ''
|
||||||
else:
|
else:
|
||||||
result = self.readbuf[ :bytes ]
|
result = self.readbuf[ :maxbytes ]
|
||||||
self.readbuf = self.readbuf[ bytes: ]
|
self.readbuf = self.readbuf[ maxbytes: ]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def readline( self ):
|
def readline( self ):
|
||||||
|
|||||||
+3
-3
@@ -136,13 +136,13 @@ def createLink( node1, node2, port1=None, port2=None ):
|
|||||||
|
|
||||||
# IP and Mac address formatting and parsing
|
# IP and Mac address formatting and parsing
|
||||||
|
|
||||||
def _colonHex( val, bytes ):
|
def _colonHex( val, count ):
|
||||||
"""Generate colon-hex string.
|
"""Generate colon-hex string.
|
||||||
val: input as unsigned int
|
val: input as unsigned int
|
||||||
bytes: number of bytes to convert
|
count: number of bytes to convert
|
||||||
returns: chStr colon-hex string"""
|
returns: chStr colon-hex string"""
|
||||||
pieces = []
|
pieces = []
|
||||||
for i in range( bytes - 1, -1, -1 ):
|
for i in range( count - 1, -1, -1 ):
|
||||||
piece = ( ( 0xff << ( i * 8 ) ) & val ) >> ( i * 8 )
|
piece = ( ( 0xff << ( i * 8 ) ) & val ) >> ( i * 8 )
|
||||||
pieces.append( '%02x' % piece )
|
pieces.append( '%02x' % piece )
|
||||||
chStr = ':'.join( pieces )
|
chStr = ':'.join( pieces )
|
||||||
|
|||||||
Reference in New Issue
Block a user