Your IP : 18.225.54.199


Current Path : /opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/__pycache__/webbrowser.cpython-33.pyo

�
��f�Yc@s}dZddlZddlZddlZddlZddlZddlZddlZddddddgZGd	d�de	�Z
iZgZdd
dd�Zddd�ZddTd
d�Zdd�Zdd�Zd
dd�Zejdd�dkrdd�Zndd�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZeZGd#d$�d$e�ZGd%d&�d&e�Z e Z!Gd'd(�d(e�Z"Gd)d*�d*e�Z#Gd+d,�d,e�Z$Gd-d.�d.e�Z%d/d0�Z&ej'jd1�rTe&�nej'jd2�r"ed3�r�ed3ded3��ned4�r�ed4ded4��ned5�r�ed5de#d5��ned6�r�ed6ded6��ned7�r"ed7ded7��q"nejdd�dkr�Gd8d9�d9e�Z(gZiZed:e(�ej)j*ej'jd;d<�d=�Z+xKd>d?d@dAdBdCe+fD]+Z,ee,�r�ee,dee,��q�q�WnejdDkreGdEdF�dFe�Z-GdGdH�dHe�Z.edIde.dI�dU�ed>de.d>�dV�edFde.dJ�dW�nejdd�dKkr�edB�r�gZiZedLdedMdBdNg�dX�ndOej'krWej'dOj/ej0�Z1e1j2�xXe1D]PZ3e3dPkr�ee3dY�Z4e4d
dkrDee3dee3�dZ�qDq�q�WdZ3[3[1ndQdR�Z5e6dSkrye5�ndS([u?Interfaces for launching and remotely controlling Web browsers.iNuErroruopenuopen_newuopen_new_tabugeturegistercBs|EeZdZdS(uErrorN(u__name__u
__module__u__qualname__(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuErrorsicCsU||gt|j�<|dkr2tj|�n|dkrQtjd|�ndS(u9Register a browser connector and, optionally, connection.iN(u	_browsersuloweru	_tryorderuappenduinsert(unameuklassuinstanceuupdate_tryorder((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuregisters
cCs�|dk	r|g}nt}x�|D]�}d|krwtj|�}|ddkrjt|dd��St|�Sq%yt|j�}Wntk
r�t	|�}YnX|ddk	r�|dS|ddk	r%|d�Sq%Wt
d��dS(	uCReturn a browser launcher instance appropriate for the environment.u%siu&Niu!could not locate runnable browseri����i����(uNoneu	_tryorderushlexusplituBackgroundBrowseruGenericBrowseru	_browsersuloweruKeyErroru_synthesizeuError(uusingualternativesubrowserucommand((u//opt/alt/python33/lib64/python3.3/webbrowser.pyugets$


cCs:x3tD]+}t|�}|j|||�rdSqWdS(NTF(u	_tryorderugetuopenuTrueuFalse(uurlunewu	autoraiseunameubrowser((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen;s

cCs
t|d�S(Ni(uopen(uurl((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen_newBscCs
t|d�S(Ni(uopen(uurl((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen_new_tabEscCs�|j�d}t|�s&ddgStjj|�}yt|j�}Wntk
rjddgSYnX|d}|r�|j�|jkr�ddl	}|j	|�}||_
tjj|�|_t|d||�d|gSddgS(u�Attempt to synthesize a controller base on existing controllers.

    This is useful to create a controller when a user specifies a path to
    an entry in the BROWSER environment variable -- we can copy a general
    controller to operate using a specific installation of the desired
    browser in this way.

    If we can't create a controller in this way, or if there is no
    executable for the requested browser, return [None, None].

    iiN(usplitu
_iscommanduNoneuosupathubasenameu	_browsersuloweruKeyErrorucopyunameuregister(ubrowseruupdate_tryorderucmdunameucommandu
controllerucopy((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu_synthesizeIs"


	
u_synthesizeiuwincCs`|j�}tjj|�r1|jd�r1dSx(dD] }tjj||�r8dSq8WdS(Nu.exeu.bat(u.exeu.batT(u.exeu.batF(uloweruosupathuisfileuendswithuTrueuFalse(ucmduext((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu
_isexecutablejs!
u
_isexecutablecCsZtjj|�rVtj|�tj}|tj@sO|tj@sO|tj@rVdSndS(NTF(
uosupathuisfileustatuST_MODEuS_IXUSRuS_IXGRPuS_IXOTHuTrueuFalse(ucmdumode((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu
_isexecutabless
'cCsrt|�rdStjjd�}|s,dSx?|jtj�D]+}tjj	||�}t|�r?dSq?WdS(uSReturn True if cmd is executable or can be found on the executable
    search path.uPATHTF(
u
_isexecutableuTrueuosuenvironugetuFalseusplitupathsepupathujoin(ucmdupathuduexe((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu
_iscommandzsu
_iscommandcBs\|EeZdZdZdgZddd�Zdddd�Zd	d
�Zdd�Z	d
S(uBaseBrowseru3Parent class for all browsers. Do not use directly.u%sucCs||_||_dS(N(unameubasename(uselfuname((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu__init__�s	uBaseBrowser.__init__icCs
t�dS(N(uNotImplementedError(uselfuurlunewu	autoraise((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen�suBaseBrowser.opencCs|j|d�S(Ni(uopen(uselfuurl((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen_new�suBaseBrowser.open_newcCs|j|d�S(Ni(uopen(uselfuurl((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen_new_tab�suBaseBrowser.open_new_tabNT(
u__name__u
__module__u__qualname__u__doc__uargsu__init__uTrueuopenuopen_newuopen_new_tab(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuBaseBrowser�s	uBaseBrowsercBs8|EeZdZdZdd�Zdddd�ZdS(	uGenericBrowseruVClass for all browsers started with a command
       and without remote functionality.cCsct|t�r'||_dg|_n |d|_|dd�|_tjj|j�|_dS(Nu%sii(u
isinstanceustrunameuargsuosupathubasename(uselfuname((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu__init__�s	
uGenericBrowser.__init__ics�|jg�fdd�|jD�}yOtjdd�dkrTtj|�}ntj|dd�}|j�SWntk
r�dSYnXdS(Ncs"g|]}|jd���qS(u%s(ureplace(u.0uarg(uurl(u//opt/alt/python33/lib64/python3.3/webbrowser.pyu
<listcomp>�s	u'GenericBrowser.open.<locals>.<listcomp>iuwinu	close_fdsTF(
unameuargsusysuplatformu
subprocessuPopenuTrueuwaituOSErroruFalse(uselfuurlunewu	autoraiseucmdlineup((uurlu//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen�s
uGenericBrowser.openNT(u__name__u
__module__u__qualname__u__doc__u__init__uTrueuopen(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuGenericBrowser�s
uGenericBrowsercBs,|EeZdZdZdddd�ZdS(uBackgroundBrowseruHClass for all browsers which are to be started in the
       background.ics�|jg�fdd�|jD�}y�tjdd�dkrTtj|�}nHttdd�}|s�ttdd�}ntj|dd	d|�}|j
�dkSWntk
r�d
SYnXdS(Ncs"g|]}|jd���qS(u%s(ureplace(u.0uarg(uurl(u//opt/alt/python33/lib64/python3.3/webbrowser.pyu
<listcomp>�s	u*BackgroundBrowser.open.<locals>.<listcomp>iuwinusetsidusetpgrpu	close_fdsu
preexec_fnTF(
unameuargsusysuplatformu
subprocessuPopenugetattruosuNoneuTrueupolluOSErroruFalse(uselfuurlunewu	autoraiseucmdlineupusetsid((uurlu//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen�s
uBackgroundBrowser.openNT(u__name__u
__module__u__qualname__u__doc__uTrueuopen(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuBackgroundBrowser�suBackgroundBrowsercBsh|EeZdZdZd	Zd
ZdZ	ddgZ
d	Zd	Zd	Z
dd�Zdddd�Zd	S(uUnixBrowseru=Parent class for all Unix browsers with remote functionality.u%actionu%sc
Cs&g}|rC|jrCt|�}|j|}|rC|g}qCn|jg||}|sf|jrrtj}nd}tj|ddd|d|j	r�|p�dd|dd�}|r�y|j
d�}	|	SWq"tjk
r�dSYq"Xn1|jr|j�dkrdSdSn|j
�SdS(	Nu	close_fdsustdinustdoutustderrustart_new_sessioniTF(u
raise_optsuintunameu
backgroundu
subprocessuDEVNULLuNoneuPopenuTrueuredirect_stdoutuwaituTimeoutExpiredupolluFalse(
uselfuargsuremoteu	autoraiseu	raise_optuoptucmdlineuinoutupurc((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu_invoke�s0
		uUnixBrowser._invokeics�|dkr|j�n_|dkr0|j�nG|dkrc|jdkrW|j�qw|j�ntdd|����fdd�|jD�}dd�|D�}|j|d
|�}|s��fd	d�|jD�}|j|dd�Sd
SdS(NiiiuBad 'new' parameter to open(); uexpected 0, 1, or 2, got %scs.g|]$}|jd��jd���qS(u%su%action(ureplace(u.0uarg(uactionuurl(u//opt/alt/python33/lib64/python3.3/webbrowser.pyu
<listcomp>s	u$UnixBrowser.open.<locals>.<listcomp>cSsg|]}|r|�qS(((u.0uarg((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu
<listcomp>s	cs"g|]}|jd���qS(u%s(ureplace(u.0uarg(uurl(u//opt/alt/python33/lib64/python3.3/webbrowser.pyu
<listcomp>s	TF(
u
remote_actionuremote_action_newwinuremote_action_newtabuNoneuErroruremote_argsu_invokeuTrueuargsuFalse(uselfuurlunewu	autoraiseuargsusuccess((uactionuurlu//opt/alt/python33/lib64/python3.3/webbrowser.pyuopens$
uUnixBrowser.openNFT(u__name__u
__module__u__qualname__u__doc__uNoneu
raise_optsuFalseu
backgrounduTrueuredirect_stdouturemote_argsu
remote_actionuremote_action_newwinuremote_action_newtabu_invokeuopen(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuUnixBrowser�s#uUnixBrowsercBsJ|EeZdZdZddgZddgZdZdZdZd
Z
d	S(uMozillau-Launcher class for Mozilla/Netscape browsers.u-noraiseu-raiseu-remoteuopenURL(%s%action)uu,new-windowu,new-tabNT(u__name__u
__module__u__qualname__u__doc__u
raise_optsuremote_argsu
remote_actionuremote_action_newwinuremote_action_newtabuTrueu
background(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuMozillasuMozillacBsD|EeZdZdZddgZddgZdZdZd	Z	dS(
uGaleonu,Launcher class for Galeon/Epiphany browsers.u-noraiseuu%actionu%su-nu-wNT(
u__name__u
__module__u__qualname__u__doc__u
raise_optsuremote_argsu
remote_actionuremote_action_newwinuTrueu
background(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuGaleon(suGaleoncBs>|EeZdZdZddgZdZdZdZdZ	dS(uChromeu)Launcher class for Google Chrome browser.u%actionu%suu--new-windowNT(
u__name__u
__module__u__qualname__u__doc__uremote_argsu
remote_actionuremote_action_newwinuremote_action_newtabuTrueu
background(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuChrome2suChromecBsJ|EeZdZdZddgZddgZdZdZdZd	Z
dS(
uOperau!Launcher class for Opera browser.u-noraiseuu-remoteuopenURL(%s%action)u,new-windowu	,new-pageNT(u__name__u
__module__u__qualname__u__doc__u
raise_optsuremote_argsu
remote_actionuremote_action_newwinuremote_action_newtabuTrueu
background(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuOpera>suOperacBsD|EeZdZdZddgZdZdZdZdZ	dZ
dS(	uElinksu#Launcher class for Elinks browsers.u-remoteuopenURL(%s%action)uu,new-windowu,new-tabNF(u__name__u
__module__u__qualname__u__doc__uremote_argsu
remote_actionuremote_action_newwinuremote_action_newtabuFalseu
backgrounduredirect_stdout(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuElinksIsuElinkscBs,|EeZdZdZdddd�ZdS(u	Konqueroru�Controller for the KDE File Manager (kfm, or Konqueror).

    See the output of ``kfmclient --commands``
    for more information on the Konqueror remote-control interface.
    ic"Cst|dkrd}nd}tj}ttdd�}|sQttdd�}ny4tjd||gddd|d	|d
|�}Wntk
r�YnX|j�dSy:tjdd|gddd|d	|d
|d
|�}Wntk
r�YnX|j	�dkr
dSy:tjdd|gddd|d	|d
|d
|�}Wntk
r_dSYnX|j	�dkSdS(NiunewTabuopenURLusetsidusetpgrpu	kfmclientu	close_fdsustdinustdoutustderru	konqueroru--silentu
preexec_fnukfmu-dTF(u
subprocessuDEVNULLugetattruosuNoneuPopenuTrueuOSErroruwaitupolluFalse(uselfuurlunewu	autoraiseuactionudevnullusetsidup((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen^s@		





	uKonqueror.openNT(u__name__u
__module__u__qualname__u__doc__uTrueuopen(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu	KonquerorWsu	KonquerorcBs>|EeZdZdd�Zdd�Zdd	dd�ZdS(
uGrailcCsddl}ddl}ddl}ddl}tjj|j�d�}|jtj	��d}tjj||d�}|j|�}|s�dS|j|j|j�}	xa|D]Y}
y|	j
|
�Wn;|jk
r	ytj|
�Wntk
rYnXYq�X|	Sq�WdS(Niu.grail-unixu-*(uglobupwdusocketutempfileuosupathujoinu
gettempdirugetpwuidugetuiduNoneuAF_UNIXuSOCK_STREAMuconnectuerroruunlinkuIOError(uselfuglobupwdusocketutempfileutempdiruuserufilenameumaybesusufn((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu_find_grail_rc�s*	


uGrail._find_grail_rccCs1|j�}|sdS|j|�|j�dS(Nii(u_find_grail_rcusenduclose(uselfuactionus((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu_remote�s

u
Grail._remoteicCs3|r|jd|�}n|jd|�}|S(NuLOADNEW uLOAD (u_remote(uselfuurlunewu	autoraiseuok((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopen�su
Grail.openNT(u__name__u
__module__u__qualname__u_find_grail_rcu_remoteuTrueuopen(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuGrail�suGrailcCsdtd�r%tddtd��ndtjkrYtd�rYtddtd��ndtjkr�td�r�tddtd��ndtjkr�td�r�tdttd��ntd�r�tddtd��nx3dD]+}t|�r�t|dt|��q�q�Wtd�rAtdttd��n%td�rftdttd��nx3dD]+}t|�rmt|dt|��qmqmWtd�r�tddtd��nx3dD]+}t|�r�t|dt	|��q�q�Wtd�rtddt
d��ntd�rAtddtd��ntd�r`tdtd�ndS( Nuxdg-openuGNOME_DESKTOP_SESSION_IDu	gvfs-openu
gnome-openuKDE_FULL_SESSIONu	kfmclientu
x-www-browserumozilla-firefoxufirefoxumozilla-firebirdufirebirdu	iceweaseluiceapeu	seamonkeyumozillaunetscapeukfmu	konquerorugaleonuepiphanyu	skipstoneu
google-chromeuchromeuchromiumuchromium-browseruoperaumosaicugrail(	umozilla-firefoxufirefoxumozilla-firebirdufirebirdu	iceweaseluiceapeu	seamonkeyumozillaunetscape(ugaleonuepiphany(u
google-chromeuchromeuchromiumuchromium-browser(u
_iscommanduregisteruNoneuBackgroundBrowseruosuenvironu	KonqueroruMozillauGaleonuChromeuOperauGrail(ubrowser((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuregister_X_browsers�sD


uregister_X_browsersuDISPLAYuTERMuwww-browserulinksuelinksulynxuw3mcBs&|EeZdZdddd�ZdS(uWindowsDefaulticCs2ytj|�Wntk
r)dSYnXdSdS(NFT(uosu	startfileuWindowsErroruFalseuTrue(uselfuurlunewu	autoraise((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopens

	uWindowsDefault.openNT(u__name__u
__module__u__qualname__uTrueuopen(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuWindowsDefaultsuWindowsDefaultuwindows-defaultuPROGRAMFILESuC:\Program FilesuInternet Explorer\IEXPLORE.EXEufirefoxufirebirdu	seamonkeyumozillaunetscapeuoperaudarwincBs8|EeZdZdZdd�Zdddd�ZdS(	uMacOSXu{Launcher class for Aqua browsers on Mac OS X

        Optionally specify a browser name on instantiation.  Note that this
        will not work for Aqua browsers if the user has moved the application
        package after installation.

        If no browser is specified, the default browser, as specified in the
        Internet System Preferences panel, will be used.
        cCs
||_dS(N(uname(uselfuname((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu__init__DsuMacOSX.__init__ic	Cs�d|krd|}ntt|��}|jdkrSd|jdd�}nR|jdkrkd}nd	|d
}d|jdd�}d|j||f}tjd
d�}|dkr�dS|j|�|j	�}|S(Nu:ufile:udefaultuopen location "%s"u"u%22uOmniWebuutoWindow %diuOpenURL "%s"u�tell application "%s"
                                activate
                                %s %s
                            end tellu	osascriptuwF(
uintuboolunameureplaceuosupopenuNoneuFalseuwriteuclose(	uselfuurlunewu	autoraiseuscriptutoWindowucmduosapipeurc((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopenGs 
	
uMacOSX.openNT(u__name__u
__module__u__qualname__u__doc__u__init__uTrueuopen(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuMacOSX:s	uMacOSXcBs2|EeZdZdd�Zdddd�ZdS(uMacOSXOSAScriptcCs
||_dS(N(u_name(uselfuname((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu__init__isuMacOSXOSAScript.__init__icCs�|jdkr(d|jdd�}nd|j|jdd�f}tjdd�}|dkridS|j|�|j�}|S(	Nudefaultuopen location "%s"u"u%22u�
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   u	osascriptuwF(u_nameureplaceuosupopenuNoneuFalseuwriteuclose(uselfuurlunewu	autoraiseuscriptuosapipeurc((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuopenls
uMacOSXOSAScript.openNT(u__name__u
__module__u__qualname__u__init__uTrueuopen(u
__locals__((u//opt/alt/python33/lib64/python3.3/webbrowser.pyuMacOSXOSAScripthsuMacOSXOSAScriptusafariudefaultuos2uos2netscapeustartu%suBROWSERuc	CsEddl}dtjd}y)|jtjdd�d�\}}Wn[|jk
r�}z8t|dtj�t|dtj�tjd�WYdd}~XnXd}x>|D]6\}}|dkr�d}q�|dkr�d}q�q�Wt|�dkr t|dtj�tjd�n|d}t||�td	�dS(
NiuDUsage: %s [-n | -t] url
    -n: open new window
    -t: open new tabiuntdufileu-nu-tiu(	ugetoptusysuargvuerroruprintustderruexitulenuopen(	ugetoptuusageuoptsuargsumsgunew_winuouauurl((u//opt/alt/python33/lib64/python3.3/webbrowser.pyumain�s() 	


umainu__main__Ti����i����i����i����i����i����(7u__doc__uiouosushlexusysustatu
subprocessutimeu__all__u	ExceptionuErroru	_browsersu	_tryorderuNoneuregisterugetuTrueuopenuopen_newuopen_new_tabu_synthesizeuplatformu
_isexecutableu
_iscommanduobjectuBaseBrowseruGenericBrowseruBackgroundBrowseruUnixBrowseruMozillauNetscapeuGaleonuChromeuChromiumuOperauElinksu	KonqueroruGrailuregister_X_browsersuenvironuWindowsDefaultupathujoinuiexploreubrowseruMacOSXuMacOSXOSAScriptusplitupathsepu_userchoicesureverseucmdlineucmdumainu__name__(((u//opt/alt/python33/lib64/python3.3/webbrowser.pyu<module>s� 	N

	95>

	 .%	

#

?>