PAL.C.T MINI SHELL
��
c�|Nc
@sddZddkZddkZddkZddklZlZlZlZlZl Z l
Z
d`ZdaZdbZ
dcZddZhdd6Zdded��YZd efd
��YZdefd��YZd
efd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZheid6eid6eid6eid 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,<qWd+dfd,��YZ-d-dgd.��YZ.hei/d/6ei0d06ei1d16ei2d26ei3d36ei4d46ei5d56ei6d66ei7d76ei8d86ei9d96ei:d:6ei;d;6ei<d<6ei=d=6ei>d>6ei?d?6ei@d@6eiAdA6eiBdB6eiCdC6eiDdD6eiEdE6ZFdFdhdG��YZGdHdHdI�ZHdJefdK��YZIdLe.fdM��YZJdNe.fdO��YZKdPe.fdQ��YZLdReLfdS��YZMdTefdU��YZNdidXdddddY�ZPdVdWgdXddddZ�ZQddXd[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
i����N(t
FLAG_DISABLEDt FLAGS_SETtFLAGS_RESETtFLAGS_TOGGLEtFD_READtFD_WRITEt FD_EXCEPTiitappendtWidgetcBs#eZdZdd�Zd�ZRS(s�Base 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(twtsetCallback(tselftobjtdata((s)/usr/lib/python2.6/site-packages/snack.pyR
BscCs
t�dS(N(tNotImplementedError(R((s)/usr/lib/python2.6/site-packages/snack.pyt__init__HsN(t__name__t
__module__t__doc__tNoneR
R(((s)/usr/lib/python2.6/site-packages/snack.pyR8s tButtoncBseZdZd�ZRS(sqBasic button class, takes button text as parameter
method:
- Button(self, text): returns a button
cCsti|�|_dS(N(t_snacktbuttonR (Rttext((s)/usr/lib/python2.6/site-packages/snack.pyRRs(RRRR(((s)/usr/lib/python2.6/site-packages/snack.pyRKst
CompactButtoncBseZdZd�ZRS(s�Compact Button class (less frilly button decoration).
methods:
- CompactButton(self,text) : create button, with text.
cCsti|�|_dS(N(Rt
compactbuttonR (RR((s)/usr/lib/python2.6/site-packages/snack.pyR\s(RRRR(((s)/usr/lib/python2.6/site-packages/snack.pyRUstCheckboxcBs>eZdZd�Zd�Zd�Zd�Zdd�ZRS(s�A 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/lib/python2.6/site-packages/snack.pytvaluelscCs|iidjS(Ni(R R(R((s)/usr/lib/python2.6/site-packages/snack.pytselectedoscCs|ii||�S(N(R tcheckboxSetFlags(Rtflagtsense((s)/usr/lib/python2.6/site-packages/snack.pytsetFlagsrscCs|ii|�S(N(R tcheckboxSetValue(RR((s)/usr/lib/python2.6/site-packages/snack.pytsetValuevsicCsti||�|_dS(N(RtcheckboxR (RRtisOn((s)/usr/lib/python2.6/site-packages/snack.pyRys(RRRRRR!R#R(((s)/usr/lib/python2.6/site-packages/snack.pyR_s tSingleRadioButtoncBs#eZdZd�Zdd�ZRS(s�Single 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/lib/python2.6/site-packages/snack.pyR�sicCsB|oti||i|�|_nti|d|�|_dS(N(RtradiobuttonR R(RRtgroupR%((s)/usr/lib/python2.6/site-packages/snack.pyR�s(RRRRR(((s)/usr/lib/python2.6/site-packages/snack.pyR&|s tListboxcBsqeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d d d d d d d
�ZRS(s�Listbox 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|<dS(N(R tlistboxAddItemtkey2itemtitem2key(RRtitemR'((s)/usr/lib/python2.6/site-packages/snack.pyR�s
cCsZ|p|ii|d�}n|ii||i|�}||i|<||i|<dS(Ni(R tlistboxInsertItemR.R-(RRR/tbeforeR'((s)/usr/lib/python2.6/site-packages/snack.pytinsert�s
cCs6|ii|i|�|i|i|=|i|=dS(N(R tlistboxDeleteItemR.R-(RR/((s)/usr/lib/python2.6/site-packages/snack.pytdelete�scCsb|ii||i|�}|ii|i|�|i|i|=||i|<||i|<dS(N(R R0R.R3R-(RRR/R'((s)/usr/lib/python2.6/site-packages/snack.pytreplace�s
cCs|i|ii�S(N(R-R tlistboxGetCurrent(R((s)/usr/lib/python2.6/site-packages/snack.pytcurrent�scCs>g}|ii�}x"|D]}|i|i|�qW|S(N(R tlistboxGetSelectionRR-(Rt selectiontlistR'((s)/usr/lib/python2.6/site-packages/snack.pytgetSelection�scCs|ii|i|�dS(N(R tlistboxSetCurrentR.(RR/((s)/usr/lib/python2.6/site-packages/snack.pyt
setCurrent�scCs#h|_h|_|ii�dS(N(R-R.R tlistboxClear(R((s)/usr/lib/python2.6/site-packages/snack.pytclear�s icCsRti||||||�|_h|_h|_|o|ii|�ndS(N(RtlistboxR R-R.tlistboxSetWidth(Rtheighttscrollt
returnExittwidtht
showCursortmultipletborder((s)/usr/lib/python2.6/site-packages/snack.pyR�s
! (RRRRR2R4R5R7R;R=R?R(((s)/usr/lib/python2.6/site-packages/snack.pyR+�s
tTextboxcBs/eZdZd�Zd�Zddd�ZRS(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 ttextboxText(RR((s)/usr/lib/python2.6/site-packages/snack.pytsetText�scCs|ii|�dS(N(R t
textboxHeight(RRB((s)/usr/lib/python2.6/site-packages/snack.pyt setHeight�sicCs"ti|||||�|_dS(N(RttextboxR (RRERBRRCtwrap((s)/usr/lib/python2.6/site-packages/snack.pyR�s(RRRRKRMR(((s)/usr/lib/python2.6/site-packages/snack.pyRI�s tTextboxReflowedcBseZdddd�ZRS(ii
i����cCsrt||||�\}}}|djo*||joti||||d�nti||||d�dS(Ni����ii(treflowRIR(RRERtflexDowntflexUpt maxHeighttnewtextRB((s)/usr/lib/python2.6/site-packages/snack.pyR�s(RRR(((s)/usr/lib/python2.6/site-packages/snack.pyRP�stLabelcBs)eZdZd�Zd�Zd�ZRS(s�A 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(RR((s)/usr/lib/python2.6/site-packages/snack.pyRK�scCsti|�|_dS(N(RtlabelR (RR((s)/usr/lib/python2.6/site-packages/snack.pyR�scCs|ii|�dS(N(R tlabelSetColors(Rtcolorset((s)/usr/lib/python2.6/site-packages/snack.pyt setColors�s(RRRRKRR[(((s)/usr/lib/python2.6/site-packages/snack.pyRV�s tScalecBs eZdZd�Zd�ZRS(s�A 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(Rtamount((s)/usr/lib/python2.6/site-packages/snack.pytsetscCsti||�|_dS(N(RtscaleR (RREttotal((s)/usr/lib/python2.6/site-packages/snack.pyR s(RRRR_R(((s)/usr/lib/python2.6/site-packages/snack.pyR\�s tEntrycBsDeZdZd�Zdd�Zd�Zdddddd�ZRS(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/lib/python2.6/site-packages/snack.pyRsicCs|ii||�S(N(R t
entrySetValue(RRtcursorAtEnd((s)/usr/lib/python2.6/site-packages/snack.pyR_scCs|ii||�S(N(R t
entrySetFlags(RRR ((s)/usr/lib/python2.6/site-packages/snack.pyR! sticCs%ti||||||�|_dS(N(RtentryR (RRERthiddentpasswordRCRD((s)/usr/lib/python2.6/site-packages/snack.pyR#s(RRRRR_R!R(((s)/usr/lib/python2.6/site-packages/snack.pyRbs
tF1tF2tF3tF4tF5tF6tF7tF8tF9tF10tF11tF12tESCt tFormcBsYeZdZd�Zd�Zd�Zd�Zd d�Zd�Z d�Z
d�ZRS(
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(Rtkeyname((s)/usr/lib/python2.6/site-packages/snack.pyt addHotKey@scCs�|iid�o+x(|ii�D]}|i|�q#Wn|iid�o%x\|iD]}|i|�q[Wn;|iid�o'||i|ii <|ii|i�SdS(NR{tgridmembersR (t__dict__thas_keyR{tkeysR}R~taddttransR R'R(RtwidgetR'R ((s)/usr/lib/python2.6/site-packages/snack.pyR�Cs
cCsj|ii�\}}|tijo|i|S|tijodS|tijo|i|St|S(NtTIMER( R trunRtFORM_EXIT_WIDGETR�tFORM_EXIT_TIMERtFORM_EXIT_FDREADYtfilemapR{(Rtwhattwhich((s)/usr/lib/python2.6/site-packages/snack.pyR�PscCs|ii�dS(N(R tdrawR(R((s)/usr/lib/python2.6/site-packages/snack.pyR�[s
cCs1h|_h|_ti|�|_||_dS(N(R�R�RtformR thelpArg(RR�((s)/usr/lib/python2.6/site-packages/snack.pyR_s cCs|ii|i�dS(N(R t
setcurrent(Rtco((s)/usr/lib/python2.6/site-packages/snack.pyR=fscCs|ii|�dS(N(R tsettimer(Rttimer((s)/usr/lib/python2.6/site-packages/snack.pytsetTimeriscCs0||i|i�<|ii|i�|�dS(N(R�tfilenoR twatchfd(Rtfiletflags((s)/usr/lib/python2.6/site-packages/snack.pyt watchFilelsN(RRRR}R�R�R�RRR=R�R�(((s)/usr/lib/python2.6/site-packages/snack.pyRy2s
tGridcBs>eZdZd�Zdddddddd�Zd�ZRS(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(Rtxty((s)/usr/lib/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
d�o#|ii|||i|||�S|ii|||i
||�SdS(NiR�(R~RRtANCHOR_LEFTtANCHOR_RIGHTt
ANCHOR_TOPt
ANCHOR_BOTTOMt
GRID_GROWXt
GRID_GROWYRR�R�tsetfieldR (
RR�tcoltrowtpaddingt
anchorLeftt anchorToptanchorRighttanchorBottomtgrowxtgrowytanchorFlagst gridFlags((s)/usr/lib/python2.6/site-packages/snack.pytsetFields&
cGs"tti|�|_g|_dS(N(tapplyRtgridR�R~(Rtargs((s)/usr/lib/python2.6/site-packages/snack.pyR�s(iiii(RRRR�R�R(((s)/usr/lib/python2.6/site-packages/snack.pyR�ps tROOTtBORDERtWINDOWtSHADOWtTITLEtBUTTONt ACTBUTTONtCHECKBOXtACTCHECKBOXtENTRYtLABELtLISTBOXt
ACTLISTBOXtTEXTBOXt
ACTTEXTBOXtHELPLINEtROOTTEXTt
EMPTYSCALEt FULLSCALEtDISENTRYt
COMPACTBUTTONt
ACTSELLISTBOXt
SELLISTBOXtSnackScreencBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zdd�Z
d�Zd �Zd
�Z
d�Zd�Zddd
�Zed�Zd�Zd�ZRS(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)
cCs3ti�ti�\|_|_|id�dS(N(RtinittsizeRERBtpushHelpLineR(R((s)/usr/lib/python2.6/site-packages/snack.pyR�s
cCs
ti�S(N(Rtfinish(R((s)/usr/lib/python2.6/site-packages/snack.pyR��scCsti�dS(N(Rtresume(R((s)/usr/lib/python2.6/site-packages/snack.pyR��scCsti�dS(N(Rtsuspend(R((s)/usr/lib/python2.6/site-packages/snack.pyR��scCs|i||�dS(N(thelpCb(Rtarg((s)/usr/lib/python2.6/site-packages/snack.pytdoHelpCallback�scCs||_ti|i�S(N(R�RthelpcallbackR�(Rtcb((s)/usr/lib/python2.6/site-packages/snack.pythelpCallback�s cCs%|oti||�Sti|�S(N(Rtsuspendcallback(RR�R
((s)/usr/lib/python2.6/site-packages/snack.pytsuspendCallback�scCsti|||||�S(N(Rt
openwindow(RtleftttopRERBttitle((s)/usr/lib/python2.6/site-packages/snack.pyt
openWindow�scCs&|ptid�Sti|�SdS(Ns *default*(Rtpushhelpline(RR((s)/usr/lib/python2.6/site-packages/snack.pyR��scCs
ti�S(N(Rtpophelpline(R((s)/usr/lib/python2.6/site-packages/snack.pytpopHelpLine�scCsti|||�S(N(Rtdrawroottext(RR�R�R((s)/usr/lib/python2.6/site-packages/snack.pytdrawRootText�scCsti|||�S(N(Rtcenteredwindow(RRERBR�((s)/usr/lib/python2.6/site-packages/snack.pytcenteredWindow�scCs;|o!|oti|i|||�Sti|i|�S(N(RtgridwrappedwindowR�(RR�R�R�R�((s)/usr/lib/python2.6/site-packages/snack.pytgridWrappedWindow�scCs|oti�Sti�S(N(Rt popwindowtpopwindownorefresh(Rtrefresh((s)/usr/lib/python2.6/site-packages/snack.pyt popWindow�scCs
ti�S(N(RR�(R((s)/usr/lib/python2.6/site-packages/snack.pyR�scCs<|tjotit|||�Sti|||�SdS(N(t colorsetsRtsetcolor(RRZtfgtbg((s)/usr/lib/python2.6/site-packages/snack.pytsetColors
N(RRRRR�R�R�R�R�RR�R�R�R�R�R�R�tTrueR�R�R�(((s)/usr/lib/python2.6/site-packages/snack.pyR��s" icCsti||||�S(sR returns a tuple of the wrapped text, the actual width, and the actual height
(RRQ(RRERRRS((s)/usr/lib/python2.6/site-packages/snack.pyRQst
RadioGroupcBs,eZdZd�Zdd�Zd�ZRS(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/lib/python2.6/site-packages/snack.pyRs cCsZ|io|djo
d}nt||i|�}||_|ii||f�|S(Ni(R�RR&R�R(RR�Rtdefaulttb((s)/usr/lib/python2.6/site-packages/snack.pyR�s
cCs0x)|iD]\}}|i�o|Sq
WdS(N(R�RR(RR�R((s)/usr/lib/python2.6/site-packages/snack.pyR;)s
N(RRRRRR�R;(((s)/usr/lib/python2.6/site-packages/snack.pyR�s
tRadioBarcBs eZdZd�Zd�ZRS(s� Bar of Radio buttons, based on Grid.
methods:
- RadioBar(self, screen, buttonlist) : constructor.
- getSelection(self): return value of selected button
cCs�g|_d|_t�|_ti|dt|��xq|D]i\}}}|ii|||�}|ii||f�|i |d|idd�|id|_q>WdS(NiiR�(
R:R/R�R*R�RtlenR�RR�(RtscreenR�R�RR�R�((s)/usr/lib/python2.6/site-packages/snack.pyR8s cCs
|ii�S(N(R*R;(R((s)/usr/lib/python2.6/site-packages/snack.pyR;Cs(RRRRR;(((s)/usr/lib/python2.6/site-packages/snack.pyR�/s t ButtonBarcBs#eZdZdd�Zd�ZRS(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|�d�x�|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/R�RR�ttypettypest
StringTypetstringtlowerRRRR�( RR�R�tcompacttblistR�RthotkeyR�((s)/usr/lib/python2.6/site-packages/snack.pyRRs&
cCsO|ii|�o|i|Sx)|iD]\}}||jo|Sq)WdS(N(R{R�R:R(RtresultRR((s)/usr/lib/python2.6/site-packages/snack.pyt
buttonPressedis
(RRRRR(((s)/usr/lib/python2.6/site-packages/snack.pyR�IstGridFormHelpcBs�eZdZd�Zdddddddd�Zd
d
d�Zd�Zd�Zd
d
d�Z d
d
d�Z
d �Zd
�Zd�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(R�R�RyR�t childListtform_createdR:R�R�Rttuple(RR�R�thelpR�((s)/usr/lib/python2.6/site-packages/snack.pyR�s
icCs<|i||||||||| |
�
|ii|�dS(N(R�RR(RR�R�R�R�R�R�R�R�R�R�((s)/usr/lib/python2.6/site-packages/snack.pyR��s
cCs#|i||�}|ii�|S(N(R�R�R�(RR�R�R((s)/usr/lib/python2.6/site-packages/snack.pytrunOnce�s
cCs|ii|�dS(N(R�R}(RR|((s)/usr/lib/python2.6/site-packages/snack.pyR}�scCs|ii|�dS(N(R�R�(RR|((s)/usr/lib/python2.6/site-packages/snack.pyR��scCsk|ip]|idd�x!|iD]}|ii|�q$W|ii||i||�d|_ndS(Ni(RR�RR�R�R�R�R�(RR�R�tchild((s)/usr/lib/python2.6/site-packages/snack.pytcreate�s
cCs|i||�|ii�S(N(R
R�R�(RR�R�((s)/usr/lib/python2.6/site-packages/snack.pyR��scCs|i�|ii�S(N(R
R�R�(R((s)/usr/lib/python2.6/site-packages/snack.pyR��s
cCs@|i�|ii||i�|ii�}|ii�|S(N(R
R�R�R�R�R�R�(RR((s)/usr/lib/python2.6/site-packages/snack.pytrunPopup�s
cCs|ii|�dS(N(R�R=(RR�((s)/usr/lib/python2.6/site-packages/snack.pyR=�s(iiiiN(RRRRR�RRR}R�R
R�R�RR=(((s)/usr/lib/python2.6/site-packages/snack.pyRss
tGridFormcBseZdZd�ZRS(sh GridForm class (extends GridFormHelp):
methods:
- GridForm(self, screen, title, *args):
cGs*|||df|}tti|�dS(N(RR�RR(RR�R�R�tmyargs((s)/usr/lib/python2.6/site-packages/snack.pyR�s(RRRR(((s)/usr/lib/python2.6/site-packages/snack.pyR�stCheckboxTreecBszeZdZddd�Zddd�Zd�Zddddd�Zd�Zd�Z d�Z
d d
�Zd�ZRS(
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(RRR/R((s)/usr/lib/python2.6/site-packages/snack.pyR�scCsM|djo
|}n|ii|||�}||i|<||i|<dS(N(RR tcheckboxtreeAddItemR-R.(RRtpathR/RR'((s)/usr/lib/python2.6/site-packages/snack.pyR�s
cCs|ii�}|i|S(N(R tcheckboxtreeGetCurrentR-(Rtcurr((s)/usr/lib/python2.6/site-packages/snack.pyt
getCurrent�scCsLti||||�|_h|_h|_|o|ii|�ndS(N(RtcheckboxtreeR R-R.tcheckboxtreeSetWidth(RRBRCREt
hide_checkboxtunselectable((s)/usr/lib/python2.6/site-packages/snack.pyR�s
cCs>g}|ii�}x"|D]}|i|i|�qW|S(N(R tcheckboxtreeGetSelectionRR-(RR9R:R'((s)/usr/lib/python2.6/site-packages/snack.pyR;�scCs|ii|i||�dS(N(R tcheckboxtreeSetEntryR.(RR/R((s)/usr/lib/python2.6/site-packages/snack.pytsetEntry�scCs|ii|i|�dS(N(R tcheckboxtreeSetCurrentR.(RR/((s)/usr/lib/python2.6/site-packages/snack.pyR=�sicCs|ii|i||�dS(N(R tcheckboxtreeSetEntryValueR.(RR/R((s)/usr/lib/python2.6/site-packages/snack.pyt
setEntryValue�scCs|ii|i|�S(N(R tcheckboxtreeGetEntryValueR.(RR/((s)/usr/lib/python2.6/site-packages/snack.pyt
getEntryValue�sN(
RRRRRRRRR;RR=R"R$(((s)/usr/lib/python2.6/site-packages/snack.pyR�s 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
|�|i�fS(s�
- ListboxChoiceWindow(screen, title, text, items,
buttons = ('Ok', 'Cancel'),
width = 40, scroll = 0, height = -1, default = None,
help = None):
i����RCRDiiiR�iR�N(iiii(R�R�RPR+R�R�t TupleTypeRRR=RR�RRR7(R�R�RtitemstbuttonsRERCRBR�R
tbbtttltcountR/R'R�trc((s)/usr/lib/python2.6/site-packages/snack.pytListboxChoiceWindow�s4
c Cs�t||�}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):
RTiiiiR�R�(iiii(R�RPRBRR�RR(R�R�RR)RER�R�R
R*R+R�((s)/usr/lib/python2.6/site-packages/snack.pytButtonChoiceWindow*sic
Cs�t||�} t||�}
d}x|D]}|d}q+Wtd|�}
d}g}x�|D]�}t|�tijo9|\}}t|�tijot||�}q�n
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}q�W| i|�t|�fS(s�
EntryWindow(screen, title, text, prompts, allowCancel = 1, width = 40,
entryWidth = 20, buttons = [ 'Ok', 'Cancel' ], help = None):
iiiR�R�iR�(iiii(iiii(iiii(R�RPR�R�R�R'tStringTypesRbR�RVRRR�RRRR (R�R�RtpromptstallowCancelREt
entryWidthR)R
R*R+R-tntsgt entryListteR�RtentryValues((s)/usr/lib/python2.6/site-packages/snack.pytEntryWindow:s@%
tCListboxc Bs�eZdZddddddddd�Zddd�Zdd�Zdd�Zd�Zdd�Z d �Z
d
�Zd�ZRS(
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
iicCs�||_||_||_||_| djo`ti|dd�d}|i| |
d|�}
t|
�|_ |i
|i dddd�nti|dd�d}t||||�|_|i
|id|dd�dS(Niitadjust_widthiR�R�(
tcolst
col_widthstcol_padtcol_text_alignRR�RtcolFormTextRVRXR�R+R@(RRBR=R>RCRDRER?R@t
col_labelstcol_label_alignR<tbox_ytlstr((s)/usr/lib/python2.6/site-packages/snack.pyRys
cCs�d}d}t|�}xy||ijoh||jo[||}ti|�}|i||jo-|o||i|<q�||i| }n|i|ti|�} | djo�|djo
t}
n||}
|
tjo|d| }n|
tjo&d| d|d| dd}n|
tjod| |}qOn||djod|i }nd}|||}|d}qW|S(NiRgRxii(
R�R=RtwstrlenR>RtLEFTtCENTERtRIGHTR?(Rtcol_texttalignR<titstrtc_lentcstrtcstrlentdeltatatpstr((s)/usr/lib/python2.6/site-packages/snack.pyRA�s:
cCsC|djo
|i}n|i||�}|ii||�dS(N(RR@RAR@R(RRJR/R@R((s)/usr/lib/python2.6/site-packages/snack.pyR�s
cCsF|djo
|i}n|i||�}|ii|||�dS(N(RR@RAR@R2(RRJR/R1R@R((s)/usr/lib/python2.6/site-packages/snack.pyR2�s
cCs|ii|�dS(N(R@R4(RR/((s)/usr/lib/python2.6/site-packages/snack.pyR4�scCsC|djo
|i}n|i||�}|ii||�dS(N(RR@RAR@R5(RRJR/R@R((s)/usr/lib/python2.6/site-packages/snack.pyR5�s
cCs
|ii�S(N(R@R7(R((s)/usr/lib/python2.6/site-packages/snack.pyR7�scCs|ii|�dS(N(R@R=(RR/((s)/usr/lib/python2.6/site-packages/snack.pyR=�scCs|ii�dS(N(R@R?(R((s)/usr/lib/python2.6/site-packages/snack.pyR?�sN(
RRRRRRARR2R4R5R7R=R?(((s)/usr/lib/python2.6/site-packages/snack.pyR;hs ) cCsd|S(Ni((R�((s)/usr/lib/python2.6/site-packages/snack.pytcustomColorset�s(i����i(i����i����(ii(ii(ii(((((R%R&(URRR�R�RRRRRRRRGtDOWNRHtUPRIRRRRRR&R+RIRPRVR\RbtKEY_F1tKEY_F2tKEY_F3tKEY_F4tKEY_F5tKEY_F6tKEY_F7tKEY_F8tKEY_F9tKEY_F10tKEY_F11tKEY_F12tKEY_ESCtordR{R�R5RyR�t
COLORSET_ROOTtCOLORSET_BORDERtCOLORSET_WINDOWtCOLORSET_SHADOWtCOLORSET_TITLEtCOLORSET_BUTTONtCOLORSET_ACTBUTTONtCOLORSET_CHECKBOXtCOLORSET_ACTCHECKBOXtCOLORSET_ENTRYtCOLORSET_LABELtCOLORSET_LISTBOXtCOLORSET_ACTLISTBOXtCOLORSET_TEXTBOXtCOLORSET_ACTTEXTBOXtCOLORSET_HELPLINEtCOLORSET_ROOTTEXTtCOLORSET_EMPTYSCALEtCOLORSET_FULLSCALEtCOLORSET_DISENTRYtCOLORSET_COMPACTBUTTONtCOLORSET_ACTSELLISTBOXtCOLORSET_SELLISTBOXR�R�RQR�R�R�RRRRR/R0R:R;RT(((s)/usr/lib/python2.6/site-packages/snack.pyt<module>(s�4
A !$
>.
U*I9) -s
�
y���~�or�5�J�={��E��e�u磝Qk��ᯘG{�?���+�]������ן�?w�M3X^��歌>{�7پ�K�>�o��n�\����j�y��R���g/�=��f�O��r�o��NV�v��~�Y+��NG�u���Ý����HW��y�w�[eQ�ʨ�S�b��>������>�}G�mx[o[<��{���Ϯ_��qF���vMIEND�B`�