dhcpcanon/dhcpcapfsm.py
def set_timeout(self, state, function, newtimeout):
        """
        Workaround to change timeout values in the ATMT.timeout class method.

        self.timeout format is::

            {'STATE': [
                (TIMEOUT0, <function foo>),
                (TIMEOUT1, <function bar>)),
                (None, None)
                ],
            }


        """
        state = STATES2NAMES[state]
        for timeout_fn_t in self.timeout[state]:
            # access the function name
            if timeout_fn_t[1] is not None and \
               timeout_fn_t[1].atmt_condname == function.atmt_condname:
                # convert list to tuple to make it mutable
                timeout_l = list(timeout_fn_t)
                # modify the timeout
                timeout_l[0] = newtimeout
                # set the new timeoute to self.timeout
                i = self.timeout[state].index(timeout_fn_t)
                self.timeout[state][i] = tuple(timeout_l)
                logger.debug('Set state %s, function %s, to timeout %s',
                             state, function.atmt_condname, newtimeout)
def set_timeout(self, state, function, newtimeout):
        state = STATES2NAMES[state]
        for timeout_fn_t in self.timeout[state]:
            # access the function name
            if timeout_fn_t[1] is not None and \
               timeout_fn_t[1].atmt_condname == function.atmt_condname:
                # convert list to tuple to make it mutable
                timeout_l = list(timeout_fn_t)
                # modify the timeout
                timeout_l[0] = newtimeout
                # set the new timeoute to self.timeout
                i = self.timeout[state].index(timeout_fn_t)
                self.timeout[state][i] = tuple(timeout_l)
                logger.debug('Set state %s, function %s, to timeout %s',
                             state, function.atmt_condname, newtimeout)
def set_timeout ( self , state , function , newtimeout ) : state = STATES2NAMES [ state ] for timeout_fn_t in self . timeout [ state ] : # access the function name if timeout_fn_t [ 1 ] is not None and timeout_fn_t [ 1 ] . atmt_condname == function . atmt_condname : # convert list to tuple to make it mutable timeout_l = list ( timeout_fn_t ) # modify the timeout timeout_l [ 0 ] = newtimeout # set the new timeoute to self.timeout i = self . timeout [ state ] . index ( timeout_fn_t ) self . timeout [ state ] [ i ] = tuple ( timeout_l ) logger . debug ( 'Set state %s, function %s, to timeout %s' , state , function . atmt_condname , newtimeout )
Workaround to change timeout values in the ATMT.timeout class method.

        self.timeout format is::

            {'STATE': [
                (TIMEOUT0, <function foo>),
                (TIMEOUT1, <function bar>)),
                (None, None)
                ],
            }
Workaround to change timeout values in the ATMT . timeout class method .