;Sc@sdZddlZddlZddlZddlmZmZmZmZmZm Z m Z deZ dfZ dgZ dhZdiZidd6ZddjdYZd efd YZd efd YZd efdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZiejd6ejd6ejd6ejd 6ej d!6ej!d"6ej"d#6ej#d$6ej$d%6ej%d&6ej&d'6ej'd(6ej(d)6ej)d*6ej*d+6ej+d,6ej,d-6ej-d.6e.d/d/6Z/x"e/j0D]Z1e1e/e/e1d:6ej?d;6ej@d<6ejAd=6ejBd>6ejCd?6ejDd@6ejEdA6ejFdB6ejGdC6ejHdD6ejIdE6ejJdF6ejKdG6ejLdH6ejMdI6ejNdJ6ZOdKdmdLYZPdMdMdNZQdOefdPYZRdQe7fdRYZSdSe7fdTYZTdUe7fdVYZUdWeUfdXYZVdYefdZYZWdnd]ddddd^ZYd[d\gd]dddd_ZZdd]d`d[d\gddaZ[dbe7fdcYZ\ddZ]dS(os This module provides the NEWT Windowing toolkit API for Python This is a lightweight text-mode windowing library, based on slang. Classes: - Widget - Button - CompactButton - Checkbox - SingleRadioButton - Listbox - Textbox - TextboxReflowed - Label - Scale - Entry - Form - Grid - SnackScreen - RadioGroup - RadioBar - ButtonBar - GridFormHelp - GridForm - CheckboxTree - Clistbox Functions: - ListboxChoiceWindow - ButtonChoiceWindow - EntryWindow iN(t FLAG_DISABLEDt FLAGS_SETt FLAGS_RESETt FLAGS_TOGGLEtFD_READtFD_WRITEt FD_EXCEPTiitappendtWidgetcBs#eZdZddZdZRS(sBase class for NEWT toolkit - Do not use directly methods: - Widget(self) - setCallback(self, obj, data = None) : The callback for when object activated. data is passed to obj. cCs0|r|jj||n|jj|dS(N(twt setCallback(tselftobjtdata((s+/usr/lib64/python2.7/site-packages/snack.pyR BscCs tdS(N(tNotImplementedError(R ((s+/usr/lib64/python2.7/site-packages/snack.pyt__init__HsN(t__name__t __module__t__doc__tNoneR R(((s+/usr/lib64/python2.7/site-packages/snack.pyR8s  tButtoncBseZdZdZRS(sqBasic button class, takes button text as parameter method: - Button(self, text): returns a button cCstj||_dS(N(t_snacktbuttonR (R ttext((s+/usr/lib64/python2.7/site-packages/snack.pyRRs(RRRR(((s+/usr/lib64/python2.7/site-packages/snack.pyRKst CompactButtoncBseZdZdZRS(sCompact Button class (less frilly button decoration). methods: - CompactButton(self,text) : create button, with text. cCstj||_dS(N(Rt compactbuttonR (R R((s+/usr/lib64/python2.7/site-packages/snack.pyR\s(RRRR(((s+/usr/lib64/python2.7/site-packages/snack.pyRUstCheckboxcBs>eZdZdZdZdZdZddZRS(sA checkbox. methods: - Checkbox(self, text, isOn = 0) : text, and boolean as to default value - setValue(self) : set value - value(self, value) : return checkbox value - selected(self) : returns boolean - setFlags(self, flag, sense) : set flags flags: FLAG_DISABLED, FLAGS_SET, FLAGS_RESET cCs |jjS(N(R t checkboxValue(R ((s+/usr/lib64/python2.7/site-packages/snack.pytvaluelscCs|jjdkS(Ni(R R(R ((s+/usr/lib64/python2.7/site-packages/snack.pytselectedoscCs|jj||S(N(R tcheckboxSetFlags(R tflagtsense((s+/usr/lib64/python2.7/site-packages/snack.pytsetFlagsrscCs|jj|S(N(R tcheckboxSetValue(R R((s+/usr/lib64/python2.7/site-packages/snack.pytsetValuevsicCstj|||_dS(N(RtcheckboxR (R RtisOn((s+/usr/lib64/python2.7/site-packages/snack.pyRys(RRRRRR!R#R(((s+/usr/lib64/python2.7/site-packages/snack.pyR_s      tSingleRadioButtoncBs#eZdZdZddZRS(sSingle Radio Button. methods: - SingleRadioButton(text, group, isOn = 0) : create button - selected(self) : returns bool, whether or not is selected. cCs|jj|jjkS(N(R tkeyt radioValue(R ((s+/usr/lib64/python2.7/site-packages/snack.pyRsicCs@|r$tj||j||_ntj|d||_dS(N(Rt radiobuttonR R(R RtgroupR%((s+/usr/lib64/python2.7/site-packages/snack.pyRs(RRRRR(((s+/usr/lib64/python2.7/site-packages/snack.pyR&|s tListboxcBsqeZdZdZdZdZdZdZdZdZ dZ d d d d d d d Z RS( sListbox class. methods: - Listbox(self, height, scroll = 0, returnExit = 0, width = 0, showCursor = 0, multiple = 0, border = 0) - insert(self, text, item, before) : insert element; before = key to item to insert before, or None. - delete(self, item) : delete item from list. - replace(self, text,item) : Replace a given item's text - current(self) : returns currently selected item - getSelection(self) : returns a list of selected items - setCurrent(self,i tem) : select current. - clear(self) : clear listbox cCs0|jj|}||j|<||j|g}|jj}x"|D]}|j|j|qW|S(N(R tlistboxGetSelectionRR-(R t selectiontlistR'((s+/usr/lib64/python2.7/site-packages/snack.pyt getSelections  cCs|jj|j|dS(N(R tlistboxSetCurrentR.(R R/((s+/usr/lib64/python2.7/site-packages/snack.pyt setCurrentscCs#i|_i|_|jjdS(N(R-R.R t listboxClear(R ((s+/usr/lib64/python2.7/site-packages/snack.pytclears  icCsPtj|||||||_i|_i|_|rL|jj|ndS(N(RtlistboxR R-R.tlistboxSetWidth(R theighttscrollt returnExittwidtht showCursortmultipletborder((s+/usr/lib64/python2.7/site-packages/snack.pyRs !  ( RRRRR2R4R5R7R;R=R?R(((s+/usr/lib64/python2.7/site-packages/snack.pyR+s         tTextboxcBs/eZdZdZdZdddZRS(sTextbox, container for text. methods: - Textbox(self, width, height, scroll = 0, wrap = 0): scroll, wrap are flags include scroll bars, or text wrap. - setText(text) : set text. - setHeight(height): set height. cCs|jj|dS(N(R t textboxText(R R((s+/usr/lib64/python2.7/site-packages/snack.pytsetTextscCs|jj|dS(N(R t textboxHeight(R RB((s+/usr/lib64/python2.7/site-packages/snack.pyt setHeightsicCs"tj||||||_dS(N(RttextboxR (R RERBRRCtwrap((s+/usr/lib64/python2.7/site-packages/snack.pyRs(RRRRKRMR(((s+/usr/lib64/python2.7/site-packages/snack.pyRIs   tTextboxReflowedcBseZddddZRS(ii icCsot||||\}}}|dkrR||krRtj||||dntj||||ddS(Niii(treflowRIR(R RERtflexDowntflexUpt maxHeighttnewtextRB((s+/usr/lib64/python2.7/site-packages/snack.pyRs(RRR(((s+/usr/lib64/python2.7/site-packages/snack.pyRPstLabelcBs)eZdZdZdZdZRS(sA Label (simple text). methods: - Label(self,text) : create label - setText(self,text) : change text. - setColors(self, colorset) : change individual colors cCs|jj|dS(N(R t labelText(R R((s+/usr/lib64/python2.7/site-packages/snack.pyRKscCstj||_dS(N(RtlabelR (R R((s+/usr/lib64/python2.7/site-packages/snack.pyRscCs|jj|dS(N(R tlabelSetColors(R tcolorset((s+/usr/lib64/python2.7/site-packages/snack.pyt setColorss(RRRRKRR[(((s+/usr/lib64/python2.7/site-packages/snack.pyRVs  tScalecBs eZdZdZdZRS(sA Scale (progress bar). methods: - Scale(self,width, total) : create scale; width: size on screen, fullamount: integer. - set(self,amount) : set amount to integer. cCs|jj|dS(N(R tscaleSet(R tamount((s+/usr/lib64/python2.7/site-packages/snack.pytsetscCstj|||_dS(N(RtscaleR (R REttotal((s+/usr/lib64/python2.7/site-packages/snack.pyR s(RRRR_R(((s+/usr/lib64/python2.7/site-packages/snack.pyR\s tEntrycBsDeZdZdZddZdZddddddZRS(sEntry widget. methods: - Entry(self, width, text = "", hidden = 0, password = 0, scroll = 1, returnExit = 0) constructor. hidden doesn't show text, password stars it out, scroll includes scroll bars; if returnExit is set, return from Form when exiting this element, else proceed to next entry widget. - value(self): return value. - set(text, cursorAtEnd = 1) : set the text - setFlags (flag, sense) : flags can be FLAG_DISABLED, FLAGS_SET, FLAGS_RESET, FLAGS_TOGGLE cCs |jjS(N(R t entryValue(R ((s+/usr/lib64/python2.7/site-packages/snack.pyRsicCs|jj||S(N(R t entrySetValue(R Rt cursorAtEnd((s+/usr/lib64/python2.7/site-packages/snack.pyR_scCs|jj||S(N(R t entrySetFlags(R RR ((s+/usr/lib64/python2.7/site-packages/snack.pyR! sticCs%tj|||||||_dS(N(RtentryR (R RERthiddentpasswordRCRD((s+/usr/lib64/python2.7/site-packages/snack.pyR#s(RRRRR_R!R(((s+/usr/lib64/python2.7/site-packages/snack.pyRb s      tF1tF2tF3tF4tF5tF6tF7tF8tF9tF10tF11tF12tESCtENTERtSUSPENDt BACKSPACEtDELETEtINSERTt tFormcBsYeZdZdZdZdZdZd dZdZ dZ dZ RS( s Base Form class, from which Grid, etc. inherit methods: - Form(self, helpArg = None) : constructor. - addHotKey(self, keyname) : keynames of form "F1" through "F12", "ESC" - add(self, widget) : Add a widget - run(self): run a form, expecting input - draw(self): draw form. - setTimer(self, timer) : add a timer - watchFile(self, file, flags) : watch a named file - setCurrent (self, co): Set a given widget as the current focus cCs|jjt|dS(N(R t addhotkeythotkeys(R tkeyname((s+/usr/lib64/python2.7/site-packages/snack.pyt addHotKeyGscCs|jjdr<x'|jjD]}|j|q"Wn|jjdrrxY|jD]}|j|qXWn8|jjdr||j|jj <|jj|jSdS(NRt gridmembersR ( t__dict__thas_keyRtkeysRRtaddttransR R'R(R twidgetR'R ((s+/usr/lib64/python2.7/site-packages/snack.pyRJscCsd|jj\}}|tjkr/|j|S|tjkrBdS|tjkr\|j|St|S(NtTIMER( R trunRtFORM_EXIT_WIDGETRtFORM_EXIT_TIMERtFORM_EXIT_FDREADYtfilemapR(R twhattwhich((s+/usr/lib64/python2.7/site-packages/snack.pyRWs  cCs|jjdS(N(R tdrawR(R ((s+/usr/lib64/python2.7/site-packages/snack.pyRbs cCs1i|_i|_tj||_||_dS(N(RRRtformR thelpArg(R R((s+/usr/lib64/python2.7/site-packages/snack.pyRfs  cCs|jj|jdS(N(R t setcurrent(R tco((s+/usr/lib64/python2.7/site-packages/snack.pyR=mscCs|jj|dS(N(R tsettimer(R ttimer((s+/usr/lib64/python2.7/site-packages/snack.pytsetTimerpscCs0||j|j<|jj|j|dS(N(RtfilenoR twatchfd(R tfiletflags((s+/usr/lib64/python2.7/site-packages/snack.pyt watchFilessN( RRRRRRRRRR=RR(((s+/usr/lib64/python2.7/site-packages/snack.pyR~9s      tGridcBs>eZdZdZddddddddZdZRS(syGrid class. methods: - place(self,x,y): Return what is placed at (x,y) - setField(self, what, col, row, padding = (0, 0, 0, 0), anchorLeft = 0, anchorTop = 0, anchorRight = 0, anchorBottom = 0, growx = 0, growy = 0): used to add widget 'what' to grid. - Grid(self, *args): eg. g = Grid(2,3) for 2x3 grid cCs|jj||S(N(tgtplace(R txty((s+/usr/lib64/python2.7/site-packages/snack.pyRsic Cs|jj|d} |r(tj} n|r:tj} n|rP| tjB} n|rf| tjB} nd} | r~tj} n| r| tjB} n|j j dr|j j |||j || | S|j j |||j || SdS(NiR(RRRt ANCHOR_LEFTt ANCHOR_RIGHTt ANCHOR_TOPt ANCHOR_BOTTOMt GRID_GROWXt GRID_GROWYRRRtsetfieldR ( R Rtcoltrowtpaddingt anchorLeftt anchorTopt anchorRightt anchorBottomtgrowxtgrowyt anchorFlagst gridFlags((s+/usr/lib64/python2.7/site-packages/snack.pytsetFields&   cGs"ttj||_g|_dS(N(tapplyRtgridRR(R targs((s+/usr/lib64/python2.7/site-packages/snack.pyRs(iiii(RRRRRR(((s+/usr/lib64/python2.7/site-packages/snack.pyRws    tROOTtBORDERtWINDOWtSHADOWtTITLEtBUTTONt ACTBUTTONtCHECKBOXt ACTCHECKBOXtENTRYtLABELtLISTBOXt ACTLISTBOXtTEXTBOXt ACTTEXTBOXtHELPLINEtROOTTEXTt EMPTYSCALEt FULLSCALEtDISENTRYt COMPACTBUTTONt ACTSELLISTBOXt SELLISTBOXt SnackScreencBseZdZdZdZdZdZdZdZddZ dZ d Z d Z d Zd Zddd ZedZdZdZRS(s A Screen; methods: - Screen(self) : constructor - finish(self) - resume(self) - suspend(self) - doHelpCallback(self,arg) call callback with arg - helpCallback(self,cb): Set help callback - suspendcallback(self,cb, data=None) : set callback. data=data to pass to cb. - openWindow(self,left, top, width, height, title): Open a window. - pushHelpLine(self,text): put help line on screen. Returns current help line if text=None - setColor(self, colorset, fg, bg): Set foreground and background colors; colorset = key from snack.colorsets, fg & bg = english color names defined by S-Lang (ref: S-Lang Library C Programmer's Guide section: 8.4.4. Setting Character Attributes) cCs3tjtj\|_|_|jddS(N(RtinittsizeRERBt pushHelpLineR(R ((s+/usr/lib64/python2.7/site-packages/snack.pyRs cCs tjS(N(Rtfinish(R ((s+/usr/lib64/python2.7/site-packages/snack.pyRscCstjdS(N(Rtresume(R ((s+/usr/lib64/python2.7/site-packages/snack.pyRscCstjdS(N(Rtsuspend(R ((s+/usr/lib64/python2.7/site-packages/snack.pyRscCs|j||dS(N(thelpCb(R targ((s+/usr/lib64/python2.7/site-packages/snack.pytdoHelpCallbackscCs||_tj|jS(N(RRt helpcallbackR(R tcb((s+/usr/lib64/python2.7/site-packages/snack.pyt helpCallbacks cCs#|rtj||Stj|S(N(Rtsuspendcallback(R RR ((s+/usr/lib64/python2.7/site-packages/snack.pytsuspendCallbackscCstj|||||S(N(Rt openwindow(R tleftttopRERBttitle((s+/usr/lib64/python2.7/site-packages/snack.pyt openWindowscCs$|stjdStj|SdS(Ns *default*(Rt pushhelpline(R R((s+/usr/lib64/python2.7/site-packages/snack.pyRs cCs tjS(N(Rt pophelpline(R ((s+/usr/lib64/python2.7/site-packages/snack.pyt popHelpLinescCstj|||S(N(Rt drawroottext(R RRR((s+/usr/lib64/python2.7/site-packages/snack.pyt drawRootTextscCstj|||S(N(Rtcenteredwindow(R RERBR((s+/usr/lib64/python2.7/site-packages/snack.pytcenteredWindowscCs8|r%|r%tj|j|||Stj|j|S(N(RtgridwrappedwindowR(R RRRR((s+/usr/lib64/python2.7/site-packages/snack.pytgridWrappedWindows cCs|rtjStjS(N(Rt popwindowtpopwindownorefresh(R trefresh((s+/usr/lib64/python2.7/site-packages/snack.pyt popWindows cCs tjS(N(RR(R ((s+/usr/lib64/python2.7/site-packages/snack.pyRscCs:|tkr#tjt|||Stj|||SdS(N(t colorsetsRtsetcolor(R RZtfgtbg((s+/usr/lib64/python2.7/site-packages/snack.pytsetColor s N(RRRRRRRRRRRRRRRRRtTrueRRR(((s+/usr/lib64/python2.7/site-packages/snack.pyRs"              icCstj||||S(sR returns a tuple of the wrapped text, the actual width, and the actual height (RRQ(RRERRRS((s+/usr/lib64/python2.7/site-packages/snack.pyRQst RadioGroupcBs,eZdZdZddZdZRS(s Combo widget: Group of Radio buttons methods: - RadioGroup(self): constructor. - add(self,title, value, default = None): add a button. Returns button. - getSelection(self) : returns value of selected button | None cCsd|_g|_dS(N(Rtprevt buttonlist(R ((s+/usr/lib64/python2.7/site-packages/snack.pyR"s cCsW|j r|dkrd}nt||j|}||_|jj||f|S(Ni(RRR&RR(R RRtdefaulttb((s+/usr/lib64/python2.7/site-packages/snack.pyR&s   cCs.x'|jD]\}}|jr |Sq WdS(N(RRR(R RR((s+/usr/lib64/python2.7/site-packages/snack.pyR;0s N(RRRRRRR;(((s+/usr/lib64/python2.7/site-packages/snack.pyRs  tRadioBarcBs eZdZdZdZRS(s Bar of Radio buttons, based on Grid. methods: - RadioBar(self, screen, buttonlist) : constructor. - getSelection(self): return value of selected button cCsg|_d|_t|_tj|dt|xq|D]i\}}}|jj|||}|jj||f|j |d|jdd|jd|_q>WdS(NiiR( R:R/RR*RRtlenRRR(R tscreenRRRRR((s+/usr/lib64/python2.7/site-packages/snack.pyR?s   cCs |jjS(N(R*R;(R ((s+/usr/lib64/python2.7/site-packages/snack.pyR;Js(RRRRR;(((s+/usr/lib64/python2.7/site-packages/snack.pyR6s t ButtonBarcBs#eZdZddZdZRS(s Bar of buttons, based on grid. methods: - ButtonBar(screen, buttonlist,buttonlist, compact = 0): - buttonPressed(self, result): Takes the widget returned by Form.run and looks to see if it was one of the widgets in the ButtonBar. ic Csg|_i|_d|_tj|t|dx|D]}t|tjkrn|}t j |}n=t|dkr|\}}n|\}}}||j|<|rt |}n t |}|jj ||f|j||jdd|jd|_q;WdS(Niii(iiii(R:RR/RRRttypettypest StringTypetstringtlowerRRRR( R RRtcompacttblistRRthotkeyR((s+/usr/lib64/python2.7/site-packages/snack.pyRYs$      cCsK|jj|r|j|Sx'|jD]\}}||kr'|Sq'WdS(N(RRR:R(R tresultRR((s+/usr/lib64/python2.7/site-packages/snack.pyt buttonPressedps   (RRRRR (((s+/usr/lib64/python2.7/site-packages/snack.pyRPs t GridFormHelpcBseZdZdZd dddddddZd d dZdZdZd d dZ d d dZ d Z d Z d Z RS(s= Subclass of Grid, for the help form text. methods: - GridFormHelp(self, screen, title, help, *args) : - add (self, widget, col, row, padding = (0, 0, 0, 0), anchorLeft = 0, anchorTop = 0, anchorRight = 0, anchorBottom = 0, growx = 0, growy = 0): - runOnce(self, x = None, y = None): pop up the help window - addHotKey(self, keyname): - setTimer(self, keyname): - create(self, x = None, y = None): - run(self, x = None, y = None): - draw(self): - runPopup(self): - setCurrent (self, co): cGsf||_||_t||_g|_d|_t|}|g|d*ttj t |dS(Ni( RRR~Rt childListt form_createdR:RRRttuple(R RRthelpR((s+/usr/lib64/python2.7/site-packages/snack.pyRs      ic Cs<|j||||||||| | |jj|dS(N(RR R( R RRRRRRRRRR((s+/usr/lib64/python2.7/site-packages/snack.pyRs  cCs#|j||}|jj|S(N(RRR(R RRR ((s+/usr/lib64/python2.7/site-packages/snack.pytrunOnces cCs|jj|dS(N(RR(R R((s+/usr/lib64/python2.7/site-packages/snack.pyRscCs|jj|dS(N(RR(R R((s+/usr/lib64/python2.7/site-packages/snack.pyRscCsi|jse|jddx!|jD]}|jj|q#W|jj||j||d|_ndS(Ni(R RR RRRRR(R RRtchild((s+/usr/lib64/python2.7/site-packages/snack.pytcreates  cCs|j|||jjS(N(RRR(R RR((s+/usr/lib64/python2.7/site-packages/snack.pyRscCs|j|jjS(N(RRR(R ((s+/usr/lib64/python2.7/site-packages/snack.pyRs cCs@|j|jj||j|jj}|jj|S(N(RRRRRRR(R R ((s+/usr/lib64/python2.7/site-packages/snack.pytrunPopups   cCs|jj|dS(N(RR=(R R((s+/usr/lib64/python2.7/site-packages/snack.pyR=s(iiiiN(RRRRRRRRRRRRRR=(((s+/usr/lib64/python2.7/site-packages/snack.pyR zs      tGridFormcBseZdZdZRS(sh GridForm class (extends GridFormHelp): methods: - GridForm(self, screen, title, *args): cGs*|||df|}ttj|dS(N(RRR R(R RRRtmyargs((s+/usr/lib64/python2.7/site-packages/snack.pyRs(RRRR(((s+/usr/lib64/python2.7/site-packages/snack.pyRst CheckboxTreecBszeZdZd ddZd ddZdZdd dddZdZdZ dZ d d Z d Z RS( s CheckboxTree combo widget, methods: - CheckboxTree(self, height, scroll = 0, width = None, hide_checkbox = 0, unselectable = 0) constructor. - append(self, text, item = None, selected = 0): - addItem(self, text, path, item = None, selected = 0): - getCurrent(self): - getSelection(self): - setEntry(self, item, text): - setCurrent(self, item): - setEntryValue(self, item, selected = 1): - getEntryValue(self, item): icCs!|j|tdf||dS(NR(taddItemt snackArgs(R RR/R((s+/usr/lib64/python2.7/site-packages/snack.pyRscCsK|dkr|}n|jj|||}||j|<||j|g}|jj}x"|D]}|j|j|qW|S(N(R tcheckboxtreeGetSelectionRR-(R R9R:R'((s+/usr/lib64/python2.7/site-packages/snack.pyR;s  cCs|jj|j||dS(N(R tcheckboxtreeSetEntryR.(R R/R((s+/usr/lib64/python2.7/site-packages/snack.pytsetEntryscCs|jj|j|dS(N(R tcheckboxtreeSetCurrentR.(R R/((s+/usr/lib64/python2.7/site-packages/snack.pyR=sicCs|jj|j||dS(N(R tcheckboxtreeSetEntryValueR.(R R/R((s+/usr/lib64/python2.7/site-packages/snack.pyt setEntryValuescCs|jj|j|S(N(R tcheckboxtreeGetEntryValueR.(R R/((s+/usr/lib64/python2.7/site-packages/snack.pyt getEntryValuesN( RRRRRRRRR;R$R=R'R)(((s+/usr/lib64/python2.7/site-packages/snack.pyRs     tOktCanceli(c  Csz|dkrt|}nt||} t||} t|d|dd} d} x|D]z}t|tjkr|\}}n |}| }|| kr|}n||kr|}n| j||| d} q^W|d kr| j |nt ||| dd}|j | dd|j | dddd |j | ddd d|j }| j || jfS( s - ListboxChoiceWindow(screen, title, text, items, buttons = ('Ok', 'Cancel'), width = 40, scroll = 0, height = -1, default = None, help = None): iRCRDiiiRiRN(iiii(RRRPR+RRt TupleTypeRRR=R RRR R7(RRRtitemstbuttonsRERCRBRRtbbtttltcountR/R'Rtrc((s+/usr/lib64/python2.7/site-packages/snack.pytListboxChoiceWindows2        c Cst||}t||d|jd} t|||dd} | j| dddd| j|dddd|j| j||S( s - ButtonChoiceWindow(screen, title, text, buttons = [ 'Ok', 'Cancel' ], width = 40, x = None, y = None, help = None): RTi iiiRR(iiii(RRPRBR RR R( RRRR.RERRRR/R0R((s+/usr/lib64/python2.7/site-packages/snack.pytButtonChoiceWindow1s ic  Cst||} t||} d} x|D]} | d} q+Wtd| } d} g}x|D]} t| tjkr| \} }t|tjkrt||}qn t|}| jt | d| dddd| j|d| dd| d} |j |qaWt |||dd}|j | dddd |j | dddd |j | dddd|j }g}d} x/|D]'} |j || j| d} qW| j|t|fS( s EntryWindow(screen, title, text, prompts, allowCancel = 1, width = 40, entryWidth = 20, buttons = [ 'Ok', 'Cancel' ], help = None): iiiRRiR(iiii(iiii(iiii(RRPRRRR,t StringTypesRbRRVRR RRRR R(RRRtpromptst allowCancelREt entryWidthR.RR/R0R2tntsgt entryListteRR t entryValues((s+/usr/lib64/python2.7/site-packages/snack.pyt EntryWindowAs:    %   tCListboxc BseZdZddddd d d ddZd ddZd dZd dZdZd dZ d Z d Z d Z RS( spClistbox convenience class. methods: - Clistbox(self, height, cols, cols_widths, scroll = 0) : constructor - colFormText(self, col_text, align = None, adjust_width = 0) : column text. - append(self, col_text, item, col_text_align = None) : - insert(self, col_text, item, before, col_text_align = None) - delete(self, item) - replace(self, col_text, item, col_text_align = None) - current(self) : returns current item - setCurrent(self, item): sets an item as current - clear(self): clear the listbox Alignments may be LEFT, RIGHT, CENTER, None iic Cs||_||_||_||_| dkrtj|ddd} |j| | d| } t| |_ |j |j ddddntj|ddd} t |||||_ |j |j d| dddS(Niit adjust_widthiRR( tcolst col_widthstcol_padtcol_text_alignRRRt colFormTextRVRXRR+R@(R RBRBRCRCRDRERDREt col_labelstcol_label_alignRAtbox_ytlstr((s+/usr/lib64/python2.7/site-packages/snack.pyRs      c Csd}d}t|}xf||jkr||kr||}tj|}|j||kr|rx||j|(s   4   A ! < >.                       U*I 9  ) -s