Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/site-packages/mercurial/win32.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�8�c
@s�ddlZddlZddlZddlZddlZejjZejjZ	ejj
ZejZ
ejZejZejZejZejZZejZeZed�jZdZdZdZej ej�ej ej�krejZ!ejZ"n9ej ej#�ej ej�kr<ej$Z!ej#Z"ndej%fd��YZ&dej%fd��YZ'd	Z(d
Z)dZ*dZ+d
Z,dZ-dZ.dZ/dZ0dej%fd��YZ1dej%fd��YZ2dZ3dZ4dej%fd��YZ5dej%fd��YZ6dej%fd��YZ7ed�jZ8eeeejeeegej9_:eej9_;eejgej<_:e
ej<_;egej=_:e
ej=_;y(eeejgej>_:e
ej>_;Wne?k
r�nXeegej@_:e
ej@_;ee
egejA_:eejA_;eejgejB_:e
ejB_;gejC_:eejC_;eejegejD_:eejD_;eeejeje
eejeejejg
ejE_:e
ejE_;egejF_:dejF_;gejH_:eejH_;ejIe
e�ZJeJe
gejK_:e
ejK_;egejL_:eejL_;eejgejM_:e
ejM_;ejejge	jN_:e
e	jN_;eejgejO_:eejO_;eejPgejQ_:e
ejQ_;ejIe
ee"�ZReRe"gejS_:e
ejS_;d�ZTd�ZUd �ZVd!�ZWd"�ZXd#�ZYd$�ZZd%�Z[d&�Z\gZ]d'�Z^d(�Z_d)�Z`d*�Zad+�Zbd,�ZcdS(-i�NiiWizt	_FILETIMEcBs eZdefdefgZRS(t
dwLowDateTimetdwHighDateTime(t__name__t
__module__t_DWORDt_fields_(((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyR's	t_BY_HANDLE_FILE_INFORMATIONcBsheZdefdefdefdefdefdefdefdefdefd	efg
ZRS(
tdwFileAttributestftCreationTimetftLastAccessTimetftLastWriteTimetdwVolumeSerialNumbert
nFileSizeHightnFileSizeLowtnNumberOfLinkstnFileIndexHight
nFileIndexLow(RRRRR(((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyR+s									iiiiii�i iit_STARTUPINFOcBs�eZdefdefdefdefdefdefdefdefdefd	efd
efdefdefd
efdejfdefdefdefgZRS(tcbt
lpReservedt	lpDesktoptlpTitletdwXtdwYtdwXSizetdwYSizet
dwXCountCharst
dwYCountCharstdwFillAttributetdwFlagstwShowWindowtcbReserved2tlpReserved2t	hStdInputt
hStdOutputt	hStdError(	RRRt_LPSTRt_WORDtctypestc_char_pt_HANDLER(((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyRJs$																t_PROCESS_INFORMATIONcBs2eZdefdefdefdefgZRS(thProcessthThreadtdwProcessIdt
dwThreadId(RRR)RR(((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyR*^s			it_COORDcBs&eZdejfdejfgZRS(tXtY(RRR'tc_shortR(((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyR/gst_SMALL_RECTcBs>eZdejfdejfdejfdejfgZRS(tLefttToptRighttBottom(RRR'R2R(((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyR3kst_CONSOLE_SCREEN_BUFFER_INFOcBs;eZdefdefdefdefdefgZRS(tdwSizetdwCursorPositiontwAttributestsrWindowtdwMaximumWindowSize(RRR/R&R3R(((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyR8qs
				i�cCs/tj�}t|jd||jf��dS(Ns%s: %s(R'tWinErrortOSErrorterrnotstrerror(tnameterr((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyt
_raiseoserror�scCs�tj|dttBtBdttd�}|tkrBt	|�nz9t
�}tj|tj
|��svt	|�n|SWdtj|�XdS(Ni(t	_kernel32tCreateFileAt_FILE_SHARE_READt_FILE_SHARE_WRITEt_FILE_SHARE_DELETEtNonet_OPEN_EXISTINGt_FILE_FLAG_BACKUP_SEMANTICSt_INVALID_HANDLE_VALUERDRtGetFileInformationByHandleR'tbyreftCloseHandle(RBtfhtfi((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyt_getfileinfo�s
	
cCsHy&tj||d�s%t|�nWntk
rCt|�nXdS(N(REtCreateHardLinkARJRDtAttributeError(tsrctdst((s3/sys/lib/python2.7/site-packages/mercurial/win32.pytoslink�s

cCs
t|�jS(s-return number of hardlinks for the given file(RSR(RB((s3/sys/lib/python2.7/site-packages/mercurial/win32.pytnlinks�scCsLt|�}t|�}|j|jkoK|j|jkoK|j|jkS(sDReturns whether path1 and path2 refer to the same file or directory.(RSRRR(tpath1tpath2tres1tres2((s3/sys/lib/python2.7/site-packages/mercurial/win32.pytsamefile�s
cCs(t|�}t|�}|j|jkS(s7Returns whether path1 and path2 are on the same device.(RSR(RZR[R\R]((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyt
samedevice�scCsttjtt|�}|rdz5t�}tj|tj|��rO|jt	kSWdtj
|�Xntj�tkS(sOreturn True if pid is still running or unable to
    determine, False otherwiseN(
REtOpenProcesst_PROCESS_QUERY_INFORMATIONtFalseRtGetExitCodeProcessR'ROtvaluet
_STILL_ACTIVERPtGetLastErrort_ERROR_INVALID_PARAMETER(tpidthtstatus((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyttestpid�s	cCstd}tj|d�}tjdtj|�|�}|dkrOtj�n||krmtjt��n|jS(sreturn full path of hg.exeiXiiN(	R'tcreate_string_bufferREtGetModuleFileNameARJROR>t_ERROR_INSUFFICIENT_BUFFERRd(tsizetbuftlen((s3/sys/lib/python2.7/site-packages/mercurial/win32.pytexecutablepath�scCsYtd�}tj|jd�}tjtj|�tj|��sRtj�n|jS(sreturn name of current useri,i(RR'RlRdt	_advapi32tGetUserNameAROR>(RoRp((s3/sys/lib/python2.7/site-packages/mercurial/win32.pytgetusers
$cCsNd�}trdSt|�}tj|�tj|t�sJtj�ndS(s�Register a termination handler for console events including
    CTRL+C. python signal handlers do not work well with socket
    operations.
    cSstjd�dS(Ni(REtExitProcess(tevent((s3/sys/lib/python2.7/site-packages/mercurial/win32.pythandlersN(t_signalhandlert_SIGNAL_HANDLERtappendREtSetConsoleCtrlHandlertTrueR'R>(RxRi((s3/sys/lib/python2.7/site-packages/mercurial/win32.pytsetsignalhandler
s	
cCs/d�}tj�}tjt|�|�dS(NcSsIt�}tj|tj|��||jkrEtj|t�tSt	S(N(
Rt_user32tGetWindowThreadProcessIdR'RORdt
ShowWindowt_SW_HIDERbR}(thwndRhtwpid((s3/sys/lib/python2.7/site-packages/mercurial/win32.pytcallbacks	(REtGetCurrentProcessIdRtEnumWindowst_WNDENUMPROC(R�Rh((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyt
hidewindows	cCssd}tjt�}|dks-|tkr1|St�}tj|tj|��sY|S|j	j
|j	j}|S(NiO(REtGetStdHandlet_STD_ERROR_HANDLERJRMR8tGetConsoleScreenBufferInfoR'ROR<R6R4(twidtht	screenbuftcsbi((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyt	termwidth&s		cCs�t�}tjt�|_t�}d}x,tjD]!}|d|tj|f7}q4W|shd}n|d7}tj|�}tjj	dd�}|d|}t
jd|ddt
t|tj�tj|�tj|��}|s�j�n|jS(Nts%s=%sttCOMSPECscmd.exes /c (RR'tsizeofRR*tostenviront
subprocesstlist2cmdlinetgetREtCreateProcessARJRbt_CREATE_NO_WINDOWtgetcwdROR>R-(targstsitpitenvtktcomspectres((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyt
spawndetached8s$			
*cCstjj|�r+ttjd|��nx�td�D]e}d|tjdd�f}ytj	||�PWq8t
k
r�}|jtjkr��q�q8Xq8Wttjd��ytj|�WnFt
k
rt
j|t�ytj|�Wq
t
k
rq
XnXdS(s3try to implement POSIX' unlink semantics on Windowss'Unlinking directory not permitted: '%s'i
s%s-%08xil�s"No usable temporary filename foundN(R�tpathtisdirtIOErrorR@tEPERMtxrangetrandomtrandinttrenameR?tEEXISTtunlinkREtSetFileAttributesAt_FILE_ATTRIBUTE_NORMAL(tfttriesttempte((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyR�Xs(	

cCs*tj|�|r&tj|t�ndS(N(R�tmkdirRER�t#_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED(R�t
notindexed((s3/sys/lib/python2.7/site-packages/mercurial/win32.pytmakedir�s
(dR'R@R�R�R�twindlltkernel32REtadvapi32Rstuser32Rtc_longt_BOOLtc_ushortR&tc_ulongRtc_uintt_UINTt_LONGR(t_LPCSTRR%tc_void_pR)t_HWNDRdRMt_ERROR_SUCCESSRgRnR�t_WPARAMt_LPARAMt
c_longlongtc_ulonglongt	StructureRRRGRHRIRKRLR�R�RaReRR*R�R�R/R3R8R�RFtargtypestrestypeRNRPRTRUR�R`RcRfRmR�RvRJR�tWINFUNCTYPERzR|R�R�RtR�tc_intR�R�R�RDRSRXRYR^R_RkRrRuRyR~R�R�R�R�R�(((s3/sys/lib/python2.7/site-packages/mercurial/win32.pyt<module>s�<					
	$	$	

							
				
		 	4

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].