Logo Search packages:      
Sourcecode: wicd version File versions

def wicd::wnettools::Interface::_parse_dhclient (   self,
  pipe 
) [private]

Parse the output of dhclient.

Parses the output of dhclient and returns the status of
the connection attempt.

Keyword arguments:
pipe -- stdout pipe to the dhcpcd process.

Returns:
'success' if succesful', an error code string otherwise.

Definition at line 386 of file wnettools.py.

00386                                    :
        """ Parse the output of dhclient.
        
        Parses the output of dhclient and returns the status of
        the connection attempt.

        Keyword arguments:
        pipe -- stdout pipe to the dhcpcd process.
        
        Returns:
        'success' if succesful', an error code string otherwise.
        
        """
        dhclient_complete = False
        dhclient_success = False
        
        while not dhclient_complete:
            line = pipe.readline()
            if line == '':  # Empty string means dhclient is done.
                dhclient_complete = True
            else:
                print line.strip('\n')
            if line.startswith('bound'):
                dhclient_success = True
                dhclient_complete = True
                
        return self._check_dhcp_result(dhclient_success)
        
    def _parse_pump(self, pipe):


Generated by  Doxygen 1.6.0   Back to index