ó i'dWc@stdZddlZddlZddlZddlZdZdZdZd„Zd„Z e dkrpe ƒndS( srContains the get_console() function and the values it returns. DO NOT put any other code in this file. We do not want to create any other dependencies. This file will be imported as the very first thing for text installer and sysconfig tool to determine whether the system is running from a physical console or not so the appropriate locale information can be setup. iÿÿÿÿNsPhysical ConsolesSerial ConsolesUnknown Consolec CsÔd}tdƒd>}|dB}d}d}y™t|dƒ„}d}tjd tjd d|ƒƒ}tj|||tƒtjd |ƒ\}} t| ƒ} | |@rº| |@rºt St SWdQXWnt SXdS( Ns /dev/openpromtOii iitrttctIc( tordtopentarraytstructtpacktfcntltioctltTruetunpacktPHYSICAL_CONSOLEtSERIAL_CONSOLEtUNKNOWN_CONSOLE( t prom_devicetoioct opromgetconstopromcons_stdin_is_kbdtopromcons_stdout_is_fbtpromtvaluetbuftnew_oprom_sizet new_valuet new_value_hex((s getconsole.pyt get_console/s$ !   cCs[tƒ}d|GH|tkr.tjdƒn)|tkrJtjdƒn tjdƒdS(sÅ This function is used by other scripts such as text-mode-menu and milestone-config to check what kind of console the program is running. They rely on the exit code from this function. s Running from iiiN(RRtsystexitR(t console_type((s getconsole.pytmaincs    t__main__( t__doc__RR RRRRRRR t__name__(((s getconsole.pyt"s     4