'Handle a simple variable name assignment.
"varName" is the variable name being assign to.
"namespace" is the namespace dict to which to assign the variable.
"rhsNode" is the ast.Node of the right-hand side of the
assignment.
"line" is the line number on which the variable is being assigned.
"isClassVar" (optional) is a boolean indicating if this var is
a class variable, as opposed to an instance variable'

def _assignVariable(self, varName, namespace, rhsNode, line, isClassVar=0):

    log.debug('_assignVariable(varName=%r,    namespace    %s,    rhsNode=%r,    line,    isClassVar=%r)', varName, '.'.join(namespace['nspath']), rhsNode, isClassVar)
    variable = namespace['symbols'].get(varName, None)
    new_var = False
    if (variable is None):
        new_var = True
        variable = {'name': varName, 'nspath': (namespace['nspath'] + (varName,)), 'doc': None, 'types': {}, 'symbols': {}}
        attributes = []
        if (varName.startswith('__') and varName.endswith('__')):
            pass
        elif varName.startswith('__'):
            attributes.append('private')
        elif varName.startswith('_'):
            attributes.append('protected')
        variable['attributes'] = '    '.join(attributes)
        variable['declaration'] = variable
        if line:
            variable['line'] = line
        namespace['symbols'][varName] = variable
    if (isClassVar and (not ('is-class-var' in variable))):
        variable['is-class-var'] = 1
        if line:
            variable['line'] = line
    if ((not new_var) and _isfunction(variable) and isinstance(rhsNode, ast.CallFunc) and rhsNode.args and isinstance(rhsNode.args[0], ast.Name) and (variable['name'] == rhsNode.args[0].name)):
        return
    varTypes = variable['types']
    for t in self._guessTypes(rhsNode, namespace):
        log.info('guessed    type:    %s    ::=    %s', varName, t)
        if (t not in varTypes):
            varTypes[t] = 0
        varTypes[t] += 1
