Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/CommandNotFound/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyc


ROc@sddlZddlZddlZddlZddlZddlZddlZddlZddlZej	dde
jZde
fdYZde
fdYZde
fd	YZd
Zde
fdYZdS(
iNscommand-not-foundtfallbacktBinaryDatabasecBseZdZdZRS(cCshd|_|jdrdytj|d|_Wqdtjk
r`}tjd||fIJqdXndS(Ns.dbtrs%Unable to open binary database %s: %s(tNonetdbtendswithtgdbmtopenterrortsyststderr(tselftfilenameterr((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyt__init__s	cCs.|jr&|jj|r&|j|SdSdS(N(Rthas_keyR(Rtkey((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pytlookups(t__name__t
__module__RR(((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyRs	tFlatDatabasecBs,eZdZdZdZdZRS(cCsWg|_t|}x1d|DD]}|jj|jdq&W|jdS(Ncss|]}|jVqdS(N(tstrip(t.0tline((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pys	<genexpr>'st|(trowstfiletappendtsplittclose(RRtdbfileR((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyR$s
	cCs>g}x1|jD]&}|||kr|j|qqW|S(N(RR(Rtcolumnttexttresulttrow((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyR+s
cCs/x(|jD]}|j|||q
WdS(N(RR(RtcbRR"((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pytcreateColumnByCallback2scCsAg}x4|jD])}||||r|j|qqW|S(N(RR(RRR#R R!R"((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pytlookupWithCallback6s
(RRRRR$R%(((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyR"s			tProgramDatabasecBs,eZed\ZZdZdZRS(icCsMtjj|}|jddjd\|_|_t||_dS(Nt.it-(tostpathtbasenameRtarcht	componentRR(RRR+((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyRBs(cCs-|jj|}|r%|jdSgSdS(NR(RRR(RtcommandR!((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyRGs
(RRtrangetPACKAGEt
BASENAME_PATHRR(((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyR&>s	cCs;d}gtt|dD]}|| ||f^q}g|D] \}}|rD||d^qD}g|D]<\}}t|dkrq||d|d|d^qq}g|D]1\}}|D]}|r|||d^qq}	g|D]'\}}|D]}|||^qq}
t|||	|
S(sw
    return a set with spelling1 distance alternative spellings

    based on http://norvig.com/spell-correct.html
    s&abcdefghijklmnopqrstuvwxyz-_0123456789iii(R/tlentset(twordtalphabettitstatbtdeletest
transposestctreplacestinserts((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyt
similar_wordsOs7-I>4tCommandNotFoundcBsheZdZdZdd	Zd
ddZd
ZdZdZdZ	dZ
edZRS(s
programs.ds/bins/usr/bins/usr/local/bins/sbins	/usr/sbins/usr/local/sbins
/usr/gamess/usr/share/command-not-foundcCs]g|_g|_tjj|d}tjj|r]ttjt	|j
|_nddddddg|_|jj|j
|_x`tjtjjj||jgD]7}|jjttjjj||j|gqWyEtjdd	tjkp5tjd
d	tjk|_Wntk
rXt|_nXdS(Nspriority.txttmaintuniversetcontribt
restrictedsnon-freet
multiversetsudoitadmin(tprogramstpriority_overridesR)R*tjointexiststmaptstringRRt	readlinest
componentstreverset_getSourcesListtsources_listtlistdirtseptprograms_dirRR&tgrptgetgrnamtposixt	getgroupst
user_can_sudotKeyErrortFalse(Rtdata_dirtpR((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyRks		$
.5E
iicCst||krdSg}xPt|D]B}|j|}x*|D]"\}}|j|||fqEWq)Wt||krtjtd|t|fIJnft|dkr
tjtd|IJx:|D]/\}}	}
tjtd||	|
fIJqWndS(s try to correct the spelling Ns4No command '%s' found, but there are %s similar onesis$No command '%s' found, did you mean:s$ Command '%s' from package '%s' (%s)(R2R?tgetPackagesRR	R
t_(RR4tmin_lentmax_lentpossible_alternativestwtpackagestpackagetcompR^R<((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pytprint_spelling_suggestion|s&cCsYt}xC|jD]8}|jg|j|D]}||jf^q/qWt|S(N(R3RHtupdateRR-tlist(RR.R!Rtpkg((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyR_s	6cCsy]ttjjtjdddf}g|D]$}|jdkr4|j^q4SWntk
rqgSX|jdS(NtHOMEs/roots.command-not-found.blacklistt(RR)RTRJtgetenvRtIOErrorR(Rt	blacklistR((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pytgetBlacklists*3
cCsy*ddl}ddlm}|jWnttfk
rDgSXtg}xO|dtD]>}|jra|j	rax!|j
D]}|j|qWqaqaW|S(Ni(tSourcesListtwithMatcher(tapt_pkgtaptsources.sourceslistRrtinittSystemErrortImportErrorR3R\tdisabledtinvalidtcompstadd(RRtRrRRtsourceR-((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyRQscCs|d|jkr)|d|jkr)n.|d|jkr@dS|d|jkrWdSy|jj|d}Wn
d}nXy|jj|d}Wn
d}nX||pt||S(Niii(RIROtindextcmp(Rtxtytxidxtyidx((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pytsortByComponents 

cCsdtjkrdS|rttd}tjjr^t|tr^|j	tjj}n|j
tdkrtjdkrd}nd}d||f}tj
d|IJtj|jd	tqndS(
Nt COMMAND_NOT_FOUND_INSTALL_PROMPTs Do you want to install it? (N/y)RiRmssudo s%sapt-get install %ss%stshell(R)tenviront	raw_inputR`R	tstdintencodingt
isinstancetstrtdecodetlowerRXtgeteuidtstdoutt
subprocesstcallRR\(Rtpackage_nametanswertcommand_prefixtinstall_command((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pytinstall_prompts	c		Csqd}|jdrKtjj|rBtjj|g}qvg}n+g|jD]}|||rU|^qU}|r|rt|dkrtjt	di|d6tjj
|d|d6IJnOtjt	di|d6IJx.|D]&}tjd	tjj
||IJqWtt|ttj
d
djd}t|dkrtjt	d
dj
|IJddj
|krtjt	dIJqntStjjdptjjdstS||jkrtS|j|}t|dkr#|j|n>t|dkrXtjt	d|Itjdkrtjt	dIJtjd|ddIJ|j|ddnz|jrtjt	dIJtjd|ddIJ|j|ddn-tjt	di|d6|ddd6IJ|dd|jkratjt	d|ddIJqan	t|dkra|j|jtjt	d|IJxh|D]`}|d|jkrtjd	|dIJqtjd	|ddt	d|ddIJqWtjdkr(tjt	ddIJqa|jrKtjt	ddIJqatjt	d IJnt|dkS(!s7 give advice where to find the given command to stderr cSsAtjjtjj||o@tjjtjj||S(s? helper that returns if a command is found in the given prefix (R)R*RKRJtisdir(tprefixR.((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyt
_in_prefixs!t/is1Command '%(command)s' is available in '%(place)s'R.itplaces:Command '%(command)s' is available in the following placess * %stPATHRmt:s_The command could not be located because '%s' is not included in the PATH environment variable.tsbinsfThis is most likely caused by the lack of administrative privileges associated with your user account.s/usr/bin/apt-gets/usr/bin/aptitudes-The program '%s' is currently not installed. sYou can install it by typing:sapt-get install %sssudo apt-get install %ssWTo run '%(command)s' please ask your administrator to install the package '%(package)s'Rfs1You will have to enable the component called '%s's8The program '%s' can be found in the following packages:s (s-You will have to enable component called '%s't)sTry: %s <selected package>sapt-get installssudo apt-get installs-Ask your administrator to install one of them(t
startswithR)R*RKtdirnametprefixesR2R	R
R`RJRjR3RnRR\RqR_RhRXRRRZRRtsortR(	RR.tignore_installedRRRtmissingReRf((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pytadvisesh		+
;
$1 	-%
3	(s/bins/usr/bins/usr/local/bins/sbins	/usr/sbins/usr/local/sbins
/usr/games(
RRRURRRhR_RqRQRRR\R(((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyR@^s 						(RtgettextRVR)tos.pathRXRMR	RttranslationtTruetugettextR`tobjectRRR&R?R@(((sC/usr/lib/python2.7/dist-packages/CommandNotFound/CommandNotFound.pyt<module>s