(number, width, adapter, monitor, video_mem_size)
return cls(name=name, video_mem_size=video_mem_size, **mode_data)
Retrieve text or graphical mode by screen number.
Retrieve text or graphical mode by screen number.
Retrieve text or graphical mode by screen number .
def get_mode(number, width, adapter, monitor, video_mem_size):
    """Retrieve text or graphical mode by screen number."""
    try:
        if number:
            name = _MODES[adapter][number]
        else:
            name = _MODES[adapter][0, width]
    except KeyError:
        # no such mode
        raise error.BASICError(error.IFC)
    mode_data = dict(**_MODE_INFO[name])
    cls = mode_data.pop('layout')
    return cls(name=name, video_mem_size=video_mem_size, **mode_data)
def get_mode ( number , width , adapter , monitor , video_mem_size ) : try : if number : name = _MODES [ adapter ] [ number ] else : name = _MODES [ adapter ] [ 0 , width ] except KeyError : # no such mode raise error . BASICError ( error . IFC ) mode_data = dict ( * * _MODE_INFO [ name ] ) cls = mode_data . pop ( 'layout' ) return cls ( name = name , video_mem_size = video_mem_size , * * mode_data )