ó C…#Wc@sÊdZddlZddlZddlmZddlmZddlmZddl m Z m Z ddl m Z mZddlmZdd lmZdd lmZdad e fd „ƒYZdS( s# Support for editing the hostname. iÿÿÿÿN(t InstallEngine(tINSTALL_LOGGER_NAME(tSystemConfiguration(t_tSCI_HELP(t BaseScreent UIMessage(t EditField(t textwidth(t WindowAreatIdentityScreencBsueZdZedƒZedƒZdZededƒfZdZ dZ d„Z d „Z d „Z d d „ZRS( s# Let the user set the hostname sòEnter a name for this computer that identifies it on the network. It can contain letters, numbers, periods (.) and minus signs (-). The name must start and end with an alphanumeric character and must contain at least one non-digit character.sComputer Name: is/%s/identity.txttIdentityitsolariscCsÖtdkr"tjtdƒantt|ƒj|ƒttj ƒ|_ d|_ t dƒ|_ tjƒj|_|jjdtdtƒd|_ytjƒ|j_Wn#tjk rÑtj|j_nXdS(Ns .sysconfigsSystem Identityt class_typetnot_found_is_erri(tLOGGERtNonetloggingt getLoggerRtsuperR t__init__Rt HOSTNAME_TEXTthostfield_offsetthostnameRt header_textRt get_instancetdoctget_descendantsRtTruetsctsockett gethostnamet sc_hostnameterrortDEFAULT_HOSTNAME(tselftmain_win((s identity.pyR<s  c Csìd}||jjtj|ƒ7}|d7}|jjtj|ƒ|j|j}t|tj ƒ}tj d}t d|||jd|ƒ}t |d|jd|j jd|jd|jjƒ|_|jjƒ|jj|jƒdS(s7 Create an EditField for entering the hostname itscrollable_columnstwindowttexttvalidatet error_winN(t center_wint add_paragraphR t PARAGRAPHtadd_textRt win_size_xRtmintHOSTNAME_SCREEN_LENtMAX_HOSTNAME_LENR RRR R(R$t error_lineRt do_updatetactivate_object(R#ty_loctmax_colstcolsR%t hostname_area((s identity.pyt_showVs         cCs|jjƒ|j_dS(s" Save hostname to the DOC N(Rtget_textRR (R#((s identity.pyton_change_screenpscCs÷|d k rƒ|jƒ}|s"d S|djƒsGttdƒƒ‚n|jddƒjddƒjƒsóttdƒƒ‚qónp|jjƒ}|s­ttdƒƒ‚n|djƒsÒttd ƒƒ‚n|jƒróttd ƒƒ‚nd S( s/ Ensure hostname is valid per hosts(4) is6The Hostname must start with an alphanumeric characteru-tau.sInvalid charactersA Hostname is required.iÿÿÿÿs4The Hostname must end with an alphanumeric characters"The Hostname can not be all digitsN(RR:tisalnumRRtreplaceRtisdigit(R#t edit_fieldR((s identity.pyR(vs  $ N(t__name__t __module__t__doc__RR,RR0Rt HELP_DATAR1R"RR9R;RR((((s identity.pyR +s     (RCRRtsolaris_install.engineRtsolaris_install.loggerRt!solaris_install.sysconfig.sc_specRtsolaris_install.sysconfig.utilRRt&solaris_install.terminalui.base_screenRRt%solaris_install.terminalui.edit_fieldRtsolaris_install.terminalui.i18nRt&solaris_install.terminalui.window_areaR RRR (((s identity.pyts