[Netdevicelib-checkins] CVS: netdevicelib/src/netdevicelib connections.py,1.7,1.8
Status: Alpha
Brought to you by:
bluecoat93
From: <net...@li...> - 2001-09-07 01:37:16
|
Update of /cvsroot/netdevicelib/netdevicelib/src/netdevicelib In directory usw-pr-cvs1:/tmp/cvs-serv26792 Modified Files: connections.py Log Message: - bug #458825: remove command from output returned from cmd() Index: connections.py =================================================================== RCS file: /cvsroot/netdevicelib/netdevicelib/src/netdevicelib/connections.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** connections.py 2001/09/05 18:07:22 1.7 --- connections.py 2001/09/07 01:37:13 1.8 *************** *** 193,200 **** # Store the last prompt we saw self._lastPrompt = result[1].group() # Remove the prompt from the output and return the results exp = re.compile( self._device.getPrompt('command') ) ! return exp.sub( '', result[2] ) def enable( self, inPass=None ): --- 193,204 ---- # Store the last prompt we saw self._lastPrompt = result[1].group() + + # Remove the command itself from the output + exp = re.compile( '^%s\s*$\n' % inCmd, re.MULTILINE ) + output = exp.sub( '', result[2], 1 ) # Remove the prompt from the output and return the results exp = re.compile( self._device.getPrompt('command') ) ! return exp.sub( '', output ) def enable( self, inPass=None ): |