Ñò ur™Vc@sádZddkZddkZddkZddkZddkZddkiZddklZddk l Z ddk l Z ddk lZlZddklZddklZdd klZd e fd „ƒYZdS( s6 Display individual help screen or help topics screen iÿÿÿÿN(t_(tAction(t BaseScreen(tconvert_paragrapht textwidth(tListItem(t ScrollWindow(t WindowAreat HelpScreencBseeZdZd„Zd„Zd„Zd„Zd d„Zd„Z d„Z d d„Z d „Z RS( s…Show localized help file pertaining to last traversed screen or help topics list from which to choose a desired help topic. cCsütt|ƒi|ƒytitidƒ|_Wn>tij o/tii dƒtitidƒ|_nXtii d|iƒ||_ ||_ ||_ d|_d|_g|_d|_t|_d|_d|_tiƒdj|_dS(Nts<System configured with invalid locale(5), falling back to C.tCs locale=%siti386(tsuperRt__init__tlocalet setlocalet LC_MESSAGEStErrort terminaluitLOGGERtwarningtdebugt help_headert help_indextintrotNonetscreent screen_lastt help_infot help_dicttFalsettopicst scroll_regiont cur_help_idxtplatformt processortis_x86(tselftmain_winRRR((s../help_screen.pyR 3s$          cCs¥h|_g|_x`|D]X}|idoD|ii|i}|i|i|<|ii|d|ifƒqqWti i d|iƒti i d|iƒdS(s‰Setup the help_dict and help_info structures help_dict contains: key: screen name tuple: (,
) tuple: (,
) help_info contains tuples: (tuple of screen names, format of text) it sself.help_dict=%ssself.help_info=%sN( RRt help_datat __class__t__name__tinstancetappendt help_formatRRR(R%tscreensRtkey((s../help_screen.pytsetup_help_dataLs  %cCs»tiid|iiƒ|i|ii_t t i |ii i|i ƒ}||ii |i<|i|iijo#|ii i|iiidƒn |ii i|ii idƒdS(s²Remove the continue key for help screen and Help key for help topics screen. Redirect F2_Continue to display the selected topic, when at the topics list s!in set_actions self.class_name=%sN(RRRR)R*RR&t help_actionttextRtcursestKEY_F2tcontinue_actiontactionsR/RtpopR(R%t help_continue((s../help_screen.pyt set_actionses     #c Cs|ii|iƒd}||ii|i|dd|idƒ7}|d7}tdt|i ƒdd|ddƒ}t i i dt|i ƒƒ|i|d|_|i|_t|d|iƒ|_t i i d t|i ƒƒxÖt|i ƒD]Å\}}|d}|i |dd}||}t|it|ƒdƒ}ttd||dƒd|id |ƒ} t i i d |iƒ|i|djo t i i d |ƒ||_q÷q÷Wt i i d | iiƒŒ|ii|iƒ|ii|iƒdS(sDisplay the help topics screen.itmax_xtscrollable_linesty_loctx_locislines=%stwindowsrange=%sR2sself.screen_last=%ssSet cur_help_idx = %ssbeg_y=%d, beg_x=%dN(R&tset_header_textRt center_wint add_paragraphRt win_size_xRtlenRRRRRt win_size_ytlinestcolumnsRR t enumeratetminRRRR!R>tgetbegyxtactivate_object( R%R<tareatidxtinfot topic_formatt topic_titlet help_topicthilitet list_item((s../help_screen.pytdisplay_help_topics‚s8      cCs\tiid|iiƒ|ii}|i|d|_tiid|iƒt|_|S(sœCalled when user presses F2 on help topics screen. Results in show being called again to display single file help of chosen topic. scontinue_action:%siscontinue_action self.screen=%s( RRRR t active_objectRRRR(R%tdummyt cur_topic((s../help_screen.pyR5¨s    cCskd}tiid|iƒ|i|ijoE|tdƒ|i|idf}|i|i|idƒ}n)|tdƒtdƒf}tdƒ}|ii|ƒt ||i dƒ}tiid t |ƒ|ƒt d dd dd t |ƒdƒ}|i d|_|i |_t|d |iƒ|_|ii|d|idƒ|ii|iƒdS(s#Display the single file help screens%s: %ssself.screen is =%stHelpiis Not Availables%Help for this screen is not availableis help_text #lines=%d, text is %sR=R<R;R>tstart_xiN(RRRRRRt get_help_textR&R?RRBRCRRDRERFRR@R RAR=RJ(R%Rt help_textRK((s../help_screen.pyt display_help¶s& !   cCsštiid|iƒ|i|iijotiidƒt|_n,t|_|i|_ tiid|i ƒ|io|i ƒn |i ƒdS(s?Display the screen, either the single file help or help topics.sin show self.screen=%sssetting self topics to true:ssetting self.screen_last to %sN( RRRRR)R*tTrueRRRRSR[(R%((s../help_screen.pyt_showÐs      c Cs|pdSd}yÃxL|iƒD]>}||}tiid|ƒti|tiƒoPq"q"Wtiid|ƒt|ƒi i ƒ}zA|~}t i dƒ|ƒ}|i ƒ}tiid|ƒWdQXWn2tj o&tiid|ƒtdƒ}nX|S( sÿ Get the localized help text for the filename passed in. First check locid directory. If not there, strip off dot extension (fr_FR.UTF-8 becomes fr_FR). If not there, truncate to 2 chars (fr). If not there, use C. R sAccessing help file %ssOpening help file %ssUTF-8sDone reading help file %sNsUnable to open help file %ss%Help for this screen is not available(Rt _get_locidsRRRtostaccesstR_OKtopent__exit__t __enter__tcodecst getreadertreadtIOErrorR(R%tfilenamet help_filetlocidt full_patht_[1]RZ((s../help_screen.pyRYãs&   # cCs||i}|g}d|jo$|idƒd}|i|ƒnt|ƒdjo|i|d ƒn|idƒ|S(s×Generate a list of possible locales - folders to check for help screen text in. Used by get_help_text() in conjunction with a screen's indicated help text file path. The list will include one or more of: * The current locale (e.g., "en_US.UTF-8") * The current locale, stripped of encoding (e.g., "en_US") * The current language, stripped of locale (e.g., "en") * The default locale ("C") t.iiR (RtsplitR,RC(R%Rtlocids((s../help_screen.pyR^ÿs    N( R*t __module__t__doc__R R0R9RSRR5R[R]RYR^(((s../help_screen.pyR-s    &    (RrReR3RR_R"tsolaris_install.terminaluiRRt!solaris_install.terminalui.actionRt&solaris_install.terminalui.base_screenRtsolaris_install.terminalui.i18nRRt$solaris_install.terminalui.list_itemRt(solaris_install.terminalui.scroll_windowRt&solaris_install.terminalui.window_areaRR(((s../help_screen.pyts