Xc @sddZddkZddkZddkZddklZlZlZlZlZl Z l Z d`Z daZ dbZ dcZddZhdd6ZddedYZd efd YZd efd YZd efdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZheid6eid6eid6eid 6ei d!6ei!d"6ei"d#6ei#d$6ei$d%6ei%d&6ei&d'6ei'd(6ei(d)6e)d*d*6Z*x"e*i+D]Z,e,e*e*e,d>6ei?d?6ei@d@6eiAdA6eiBdB6eiCdC6eiDdD6eiEdE6ZFdFdhdGYZGdHdHdIZHdJefdKYZIdLe.fdMYZJdNe.fdOYZKdPe.fdQYZLdReLfdSYZMdTefdUYZNdidXdddddYZPdVdWgdXddddZZQddXd[dVdWgdd\ZRd]e.fd^YZSd_ZTdS(js 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. cCs2|o|ii||n|ii|dS(N(twt setCallback(tselftobjtdata((s+/usr/lib64/python2.6/site-packages/snack.pyR BscCs tdS(N(tNotImplementedError(R ((s+/usr/lib64/python2.6/site-packages/snack.pyt__init__HsN(t__name__t __module__t__doc__tNoneR R(((s+/usr/lib64/python2.6/site-packages/snack.pyR8s  tButtoncBseZdZdZRS(sqBasic button class, takes button text as parameter method: - Button(self, text): returns a button cCsti||_dS(N(t_snacktbuttonR (R ttext((s+/usr/lib64/python2.6/site-packages/snack.pyRRs(RRRR(((s+/usr/lib64/python2.6/site-packages/snack.pyRKst CompactButtoncBseZdZdZRS(sCompact Button class (less frilly button decoration). methods: - CompactButton(self,text) : create button, with text. cCsti||_dS(N(Rt compactbuttonR (R R((s+/usr/lib64/python2.6/site-packages/snack.pyR\s(RRRR(((s+/usr/lib64/python2.6/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 |iiS(N(R t checkboxValue(R ((s+/usr/lib64/python2.6/site-packages/snack.pytvaluelscCs|iidjS(Ni(R R(R ((s+/usr/lib64/python2.6/site-packages/snack.pytselectedoscCs|ii||S(N(R tcheckboxSetFlags(R tflagtsense((s+/usr/lib64/python2.6/site-packages/snack.pytsetFlagsrscCs|ii|S(N(R tcheckboxSetValue(R R((s+/usr/lib64/python2.6/site-packages/snack.pytsetValuevsicCsti|||_dS(N(RtcheckboxR (R RtisOn((s+/usr/lib64/python2.6/site-packages/snack.pyRys(RRRRRR!R#R(((s+/usr/lib64/python2.6/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|ii|iijS(N(R tkeyt radioValue(R ((s+/usr/lib64/python2.6/site-packages/snack.pyRsicCsB|oti||i||_nti|d||_dS(N(Rt radiobuttonR R(R RtgroupR%((s+/usr/lib64/python2.6/site-packages/snack.pyRs(RRRRR(((s+/usr/lib64/python2.6/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|ii|}||i|<||i|g}|ii}x"|D]}|i|i|qW|S(N(R tlistboxGetSelectionRR-(R t selectiontlistR'((s+/usr/lib64/python2.6/site-packages/snack.pyt getSelections cCs|ii|i|dS(N(R tlistboxSetCurrentR.(R R/((s+/usr/lib64/python2.6/site-packages/snack.pyt setCurrentscCs#h|_h|_|iidS(N(R-R.R t listboxClear(R ((s+/usr/lib64/python2.6/site-packages/snack.pytclears  icCsRti|||||||_h|_h|_|o|ii|ndS(N(RtlistboxR R-R.tlistboxSetWidth(R theighttscrollt returnExittwidtht showCursortmultipletborder((s+/usr/lib64/python2.6/site-packages/snack.pyRs !  ( RRRRR2R4R5R7R;R=R?R(((s+/usr/lib64/python2.6/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|ii|dS(N(R t textboxText(R R((s+/usr/lib64/python2.6/site-packages/snack.pytsetTextscCs|ii|dS(N(R t textboxHeight(R RB((s+/usr/lib64/python2.6/site-packages/snack.pyt setHeightsicCs"ti||||||_dS(N(RttextboxR (R RERBRRCtwrap((s+/usr/lib64/python2.6/site-packages/snack.pyRs(RRRRKRMR(((s+/usr/lib64/python2.6/site-packages/snack.pyRIs   tTextboxReflowedcBseZddddZRS(ii icCsrt||||\}}}|djo*||joti||||dnti||||ddS(Niii(treflowRIR(R RERtflexDowntflexUpt maxHeighttnewtextRB((s+/usr/lib64/python2.6/site-packages/snack.pyRs(RRR(((s+/usr/lib64/python2.6/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|ii|dS(N(R t labelText(R R((s+/usr/lib64/python2.6/site-packages/snack.pyRKscCsti||_dS(N(RtlabelR (R R((s+/usr/lib64/python2.6/site-packages/snack.pyRscCs|ii|dS(N(R tlabelSetColors(R tcolorset((s+/usr/lib64/python2.6/site-packages/snack.pyt setColorss(RRRRKRR[(((s+/usr/lib64/python2.6/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|ii|dS(N(R tscaleSet(R tamount((s+/usr/lib64/python2.6/site-packages/snack.pytsetscCsti|||_dS(N(RtscaleR (R REttotal((s+/usr/lib64/python2.6/site-packages/snack.pyR s(RRRR_R(((s+/usr/lib64/python2.6/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 |iiS(N(R t entryValue(R ((s+/usr/lib64/python2.6/site-packages/snack.pyRsicCs|ii||S(N(R t entrySetValue(R Rt cursorAtEnd((s+/usr/lib64/python2.6/site-packages/snack.pyR_scCs|ii||S(N(R t entrySetFlags(R RR ((s+/usr/lib64/python2.6/site-packages/snack.pyR! sticCs%ti|||||||_dS(N(RtentryR (R RERthiddentpasswordRCRD((s+/usr/lib64/python2.6/site-packages/snack.pyR#s(RRRRR_R!R(((s+/usr/lib64/python2.6/site-packages/snack.pyRb s      tF1tF2tF3tF4tF5tF6tF7tF8tF9tF10tF11tF12tESCt 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|iit|dS(N(R t addhotkeythotkeys(R tkeyname((s+/usr/lib64/python2.6/site-packages/snack.pyt addHotKey@scCs|iido+x(|iiD]}|i|q#Wn|iido%x\|iD]}|i|q[Wn;|iido'||i|ii <|ii|iSdS(NR{t gridmembersR ( t__dict__thas_keyR{tkeysR}R~taddttransR R'R(R twidgetR'R ((s+/usr/lib64/python2.6/site-packages/snack.pyRCs cCsj|ii\}}|tijo |i|S|tijodS|tijo |i|St|S(NtTIMER( R trunRtFORM_EXIT_WIDGETRtFORM_EXIT_TIMERtFORM_EXIT_FDREADYtfilemapR{(R twhattwhich((s+/usr/lib64/python2.6/site-packages/snack.pyRPs  cCs|iidS(N(R tdrawR(R ((s+/usr/lib64/python2.6/site-packages/snack.pyR[s cCs1h|_h|_ti||_||_dS(N(RRRtformR thelpArg(R R((s+/usr/lib64/python2.6/site-packages/snack.pyR_s  cCs|ii|idS(N(R t setcurrent(R tco((s+/usr/lib64/python2.6/site-packages/snack.pyR=fscCs|ii|dS(N(R tsettimer(R ttimer((s+/usr/lib64/python2.6/site-packages/snack.pytsetTimeriscCs0||i|i<|ii|i|dS(N(RtfilenoR twatchfd(R tfiletflags((s+/usr/lib64/python2.6/site-packages/snack.pyt watchFilelsN( RRRR}RRRRRR=RR(((s+/usr/lib64/python2.6/site-packages/snack.pyRy2s      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|ii||S(N(tgtplace(R txty((s+/usr/lib64/python2.6/site-packages/snack.pyR|sic Cs|ii|d} |o ti} n|o ti} n|o| tiB} n|o| tiB} nd} | o ti} n| o| tiB} n|i i do#|i i |||i || | S|i i |||i || SdS(NiR(R~RRt ANCHOR_LEFTt ANCHOR_RIGHTt ANCHOR_TOPt ANCHOR_BOTTOMt GRID_GROWXt GRID_GROWYRRRtsetfieldR ( R Rtcoltrowtpaddingt anchorLeftt anchorTopt anchorRightt anchorBottomtgrowxtgrowyt anchorFlagst gridFlags((s+/usr/lib64/python2.6/site-packages/snack.pytsetFields&   cGs"tti||_g|_dS(N(tapplyRtgridRR~(R targs((s+/usr/lib64/python2.6/site-packages/snack.pyRs(iiii(RRRRRR(((s+/usr/lib64/python2.6/site-packages/snack.pyRps    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) cCs3titi\|_|_|iddS(N(RtinittsizeRERBt pushHelpLineR(R ((s+/usr/lib64/python2.6/site-packages/snack.pyRs cCs tiS(N(Rtfinish(R ((s+/usr/lib64/python2.6/site-packages/snack.pyRscCstidS(N(Rtresume(R ((s+/usr/lib64/python2.6/site-packages/snack.pyRscCstidS(N(Rtsuspend(R ((s+/usr/lib64/python2.6/site-packages/snack.pyRscCs|i||dS(N(thelpCb(R targ((s+/usr/lib64/python2.6/site-packages/snack.pytdoHelpCallbackscCs||_ti|iS(N(RRt helpcallbackR(R tcb((s+/usr/lib64/python2.6/site-packages/snack.pyt helpCallbacks cCs%|oti||Sti|S(N(Rtsuspendcallback(R RR ((s+/usr/lib64/python2.6/site-packages/snack.pytsuspendCallbackscCsti|||||S(N(Rt openwindow(R tleftttopRERBttitle((s+/usr/lib64/python2.6/site-packages/snack.pyt openWindowscCs&|ptidSti|SdS(Ns *default*(Rt pushhelpline(R R((s+/usr/lib64/python2.6/site-packages/snack.pyRscCs tiS(N(Rt pophelpline(R ((s+/usr/lib64/python2.6/site-packages/snack.pyt popHelpLinescCsti|||S(N(Rt drawroottext(R RRR((s+/usr/lib64/python2.6/site-packages/snack.pyt drawRootTextscCsti|||S(N(Rtcenteredwindow(R RERBR((s+/usr/lib64/python2.6/site-packages/snack.pytcenteredWindowscCs;|o!|oti|i|||Sti|i|S(N(RtgridwrappedwindowR(R RRRR((s+/usr/lib64/python2.6/site-packages/snack.pytgridWrappedWindowscCs|o tiStiS(N(Rt popwindowtpopwindownorefresh(R trefresh((s+/usr/lib64/python2.6/site-packages/snack.pyt popWindows cCs tiS(N(RR(R ((s+/usr/lib64/python2.6/site-packages/snack.pyRscCs<|tjotit|||Sti|||SdS(N(t colorsetsRtsetcolor(R RZtfgtbg((s+/usr/lib64/python2.6/site-packages/snack.pytsetColors N(RRRRRRRRRRRRRRRRRtTrueRRR(((s+/usr/lib64/python2.6/site-packages/snack.pyRs"              icCsti||||S(sR returns a tuple of the wrapped text, the actual width, and the actual height (RRQ(RRERRRS((s+/usr/lib64/python2.6/site-packages/snack.pyRQ st 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.6/site-packages/snack.pyRs cCsZ|i o|djo d}nt||i|}||_|ii||f|S(Ni(RRR&RR(R RRtdefaulttb((s+/usr/lib64/python2.6/site-packages/snack.pyRs   cCs0x)|iD]\}}|io|Sq WdS(N(RRR(R RR((s+/usr/lib64/python2.6/site-packages/snack.pyR;)s   N(RRRRRRR;(((s+/usr/lib64/python2.6/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|_ti|dt|xq|D]i\}}}|ii|||}|ii||f|i |d|idd|id|_q>WdS(NiiR( R:R/RR*RRtlenRRR(R tscreenRRRRR((s+/usr/lib64/python2.6/site-packages/snack.pyR8s   cCs |iiS(N(R*R;(R ((s+/usr/lib64/python2.6/site-packages/snack.pyR;Cs(RRRRR;(((s+/usr/lib64/python2.6/site-packages/snack.pyR/s 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|_h|_d|_ti|t|dx|D]}t|tijo|}t i |}n@t|djo|\}}n|\}}}||i|<|ot |}n t |}|ii ||f|i||idd|id|_q;WdS(Niii(iiii(R:R{R/RRRttypettypest StringTypetstringtlowerRRRR( R RRtcompacttblistRRthotkeyR((s+/usr/lib64/python2.6/site-packages/snack.pyRRs&     cCsO|ii|o |i|Sx)|iD]\}}||jo|Sq)WdS(N(R{RR:R(R tresultRR((s+/usr/lib64/python2.6/site-packages/snack.pyt buttonPressedis    (RRRRR(((s+/usr/lib64/python2.6/site-packages/snack.pyRIs 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*tti t |dS(Ni( RRRyRt childListt form_createdR:RRRttuple(R RRthelpR((s+/usr/lib64/python2.6/site-packages/snack.pyRs      ic Cs<|i||||||||| | |ii|dS(N(RRR( R RRRRRRRRRR((s+/usr/lib64/python2.6/site-packages/snack.pyRs  cCs#|i||}|ii|S(N(RRR(R RRR((s+/usr/lib64/python2.6/site-packages/snack.pytrunOnces cCs|ii|dS(N(RR}(R R|((s+/usr/lib64/python2.6/site-packages/snack.pyR}scCs|ii|dS(N(RR(R R|((s+/usr/lib64/python2.6/site-packages/snack.pyRscCsk|ip]|iddx!|iD]}|ii|q$W|ii||i||d|_ndS(Ni(RRRRRRRR(R RRtchild((s+/usr/lib64/python2.6/site-packages/snack.pytcreates  cCs|i|||iiS(N(R RR(R RR((s+/usr/lib64/python2.6/site-packages/snack.pyRscCs|i|iiS(N(R RR(R ((s+/usr/lib64/python2.6/site-packages/snack.pyRs cCs@|i|ii||i|ii}|ii|S(N(R RRRRRR(R R((s+/usr/lib64/python2.6/site-packages/snack.pytrunPopups   cCs|ii|dS(N(RR=(R R((s+/usr/lib64/python2.6/site-packages/snack.pyR=s(iiiiN(RRRRRRR R}RR RRRR=(((s+/usr/lib64/python2.6/site-packages/snack.pyRss      tGridFormcBseZdZdZRS(sh GridForm class (extends GridFormHelp): methods: - GridForm(self, screen, title, *args): cGs*|||df|}tti|dS(N(RRRR(R RRRtmyargs((s+/usr/lib64/python2.6/site-packages/snack.pyRs(RRRR(((s+/usr/lib64/python2.6/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!|i|tdf||dS(NR(taddItemt snackArgs(R RR/R((s+/usr/lib64/python2.6/site-packages/snack.pyRscCsM|djo |}n|ii|||}||i|<||i|g}|ii}x"|D]}|i|i|qW|S(N(R tcheckboxtreeGetSelectionRR-(R R9R:R'((s+/usr/lib64/python2.6/site-packages/snack.pyR;s cCs|ii|i||dS(N(R tcheckboxtreeSetEntryR.(R R/R((s+/usr/lib64/python2.6/site-packages/snack.pytsetEntryscCs|ii|i|dS(N(R tcheckboxtreeSetCurrentR.(R R/((s+/usr/lib64/python2.6/site-packages/snack.pyR=sicCs|ii|i||dS(N(R tcheckboxtreeSetEntryValueR.(R R/R((s+/usr/lib64/python2.6/site-packages/snack.pyt setEntryValuescCs|ii|i|S(N(R tcheckboxtreeGetEntryValueR.(R R/((s+/usr/lib64/python2.6/site-packages/snack.pyt getEntryValuesN( RRRRRRRRR;RR=R"R$(((s+/usr/lib64/python2.6/site-packages/snack.pyRs     tOktCanceli(c  Cs|djot|}nt||} t||} t|d|dd} d} x|D]}t|tijo|\}}n |}| }|| jo |}n||jo |}n| i||| d} q`W|d jo| i |nt ||| dd}|i | dd|i | dddd |i | ddd d|i }| i || ifS( s - ListboxChoiceWindow(screen, title, text, items, buttons = ('Ok', 'Cancel'), width = 40, scroll = 0, height = -1, default = None, help = None): iRCRDiiiRiRN(iiii(RRRPR+RRt TupleTypeRRR=RRR RR7(RRRtitemstbuttonsRERCRBRR tbbtttltcountR/R'Rtrc((s+/usr/lib64/python2.6/site-packages/snack.pytListboxChoiceWindows4       c Cst||}t||d|id} t|||dd} | i| dddd| i|dddd|i| i||S( s - ButtonChoiceWindow(screen, title, text, buttons = [ 'Ok', 'Cancel' ], width = 40, x = None, y = None, help = None): RTi iiiRR(iiii(RRPRBRRRR ( RRRR)RERRR R*R+R((s+/usr/lib64/python2.6/site-packages/snack.pytButtonChoiceWindow*s ic  Cst||} t||} d} x|D]} | d} q+Wtd| } d} g}x|D]} t| tijo9| \} }t|tijot||}qn t|}| it | d| dddd| i|d| dd| d} |i |qaWt |||dd}|i | dddd |i | dddd |i | dddd|i }g}d} x/|D]'} |i || i| d} qW| i|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 StringTypesRbRRVRRRR RRR (RRRtpromptst allowCancelREt entryWidthR)R R*R+R-tntsgt entryListteRRt entryValues((s+/usr/lib64/python2.6/site-packages/snack.pyt EntryWindow:s@  %  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||_||_||_||_| djo`ti|ddd} |i| | d| } t| |_ |i |i ddddnti|ddd} t |||||_ |i |i d| dddS(Niit adjust_widthiRR( tcolst col_widthstcol_padtcol_text_alignRRRt colFormTextRVRXRR+R@(R RBR=R>RCRDRER?R@t col_labelstcol_label_alignR<tbox_ytlstr((s+/usr/lib64/python2.6/site-packages/snack.pyRys       c Csd}d}t|}xy||ijoh||jo[||}ti|}|i||jo-|o||i|RtLEFTtCENTERtRIGHTR?( R tcol_texttalignR<titstrtc_lentcstrtcstrlentdeltatatpstr((s+/usr/lib64/python2.6/site-packages/snack.pyRAs:         cCsC|djo |i}n|i||}|ii||dS(N(RR@RAR@R(R RJR/R@R((s+/usr/lib64/python2.6/site-packages/snack.pyRs  cCsF|djo |i}n|i||}|ii|||dS(N(RR@RAR@R2(R RJR/R1R@R((s+/usr/lib64/python2.6/site-packages/snack.pyR2s  cCs|ii|dS(N(R@R4(R R/((s+/usr/lib64/python2.6/site-packages/snack.pyR4scCsC|djo |i}n|i||}|ii||dS(N(RR@RAR@R5(R RJR/R@R((s+/usr/lib64/python2.6/site-packages/snack.pyR5s  cCs |iiS(N(R@R7(R ((s+/usr/lib64/python2.6/site-packages/snack.pyR7scCs|ii|dS(N(R@R=(R R/((s+/usr/lib64/python2.6/site-packages/snack.pyR=scCs|iidS(N(R@R?(R ((s+/usr/lib64/python2.6/site-packages/snack.pyR?sN( RRRRRRARR2R4R5R7R=R?(((s+/usr/lib64/python2.6/site-packages/snack.pyR;hs )      cCsd|S(Ni((R((s+/usr/lib64/python2.6/site-packages/snack.pytcustomColorsets(ii(ii(ii(ii(ii(((((R%R&(URRRRRRRRRRRRGtDOWNRHtUPRIRRRRRR&R+RIRPRVR\RbtKEY_F1tKEY_F2tKEY_F3tKEY_F4tKEY_F5tKEY_F6tKEY_F7tKEY_F8tKEY_F9tKEY_F10tKEY_F11tKEY_F12tKEY_ESCtordR{RR5RyRt COLORSET_ROOTtCOLORSET_BORDERtCOLORSET_WINDOWtCOLORSET_SHADOWtCOLORSET_TITLEtCOLORSET_BUTTONtCOLORSET_ACTBUTTONtCOLORSET_CHECKBOXtCOLORSET_ACTCHECKBOXtCOLORSET_ENTRYtCOLORSET_LABELtCOLORSET_LISTBOXtCOLORSET_ACTLISTBOXtCOLORSET_TEXTBOXtCOLORSET_ACTTEXTBOXtCOLORSET_HELPLINEtCOLORSET_ROOTTEXTtCOLORSET_EMPTYSCALEtCOLORSET_FULLSCALEtCOLORSET_DISENTRYtCOLORSET_COMPACTBUTTONtCOLORSET_ACTSELLISTBOXtCOLORSET_SELLISTBOXRRRQRRRRRRRR/R0R:R;RT(((s+/usr/lib64/python2.6/site-packages/snack.pyt(s   4   A !$ >.                       U*I 9  ) -s