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

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


��c@s�dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZmZddl
mZdZd�Zd�Zd�Zd	�Zd
�Zddd
ddddgZdS(sbrowse command output with an external pager

To set the pager that should be used, set the application variable::

  [pager]
  pager = less -FRX

If no pager is set, the pager extensions uses the environment variable
$PAGER. If neither pager.pager, nor $PAGER is set, no pager is used.

You can disable the pager for certain commands by adding them to the
pager.ignore list::

  [pager]
  ignore = version, help, update

You can also enable the pager only for certain commands using
pager.attend. Below is the default list of commands to be paged::

  [pager]
  attend = annotate, cat, diff, export, glog, log, qdiff

Setting pager.attend to an empty value will cause all commands to be
paged.

If pager.attend is present, pager.ignore will be ignored.

To ignore global commands like :hg:`version` or :hg:`help`, you have
to specify them in your user configuration file.

The --pager=... option can also be used to control when the pager is
used. Use a boolean value like yes, no, on, off, or use auto for
normal behavior.
i�N(tcommandstdispatchtutilt
extensions(t_tinternalcCs�tjtd�sLtj|d�t_|jtj�rHtjt_ndStj�\}}tj	�}|dkr�tj
|�tj|tjj��|jtj�r�tj|tjj��ntj
|�dStj|tj
j��tj
|�tj
|�ytjddd|g�WnNtk
r{}|jtjkrutj|�}tj|d|�q|�nXdS(Ntforktwbis/bin/shs-c(Rtsafehasattrtostpopentsyststdoutt_isattytstderrtpipeRtclosetdup2tfilenotstdintexecvptOSErrorterrnotENOENTtshlextsplit(tuitptfdintfdouttpidtetargs((s//sys/lib/python2.7/site-packages/hgext/pager.pyt
_pagerfork8s0



cs�tj|dtdddtjdtjdtjdtj��t	j
tjj���t	j
tjj���t	j�j
j�tjj��|jtj�r�t	j�j
j�tjj��ntj���fd��}dS(	Ntshelltbufsizei�t	close_fdsRRRcsxtjtd�r+tjtjtj�n�jj�tj�t	j
j��tj�t	jj���j
�dS(NtSIGINT(RRtsignalR%tSIG_IGNRRR	RRRRRtwait((tpagerRR(s//sys/lib/python2.7/site-packages/hgext/pager.pyt	killpager_s
(t
subprocesstPopentTrueRtclosefdstPIPERRRR	tdupRRRR
tatexittregister(RRR*((R)RRs//sys/lib/python2.7/site-packages/hgext/pager.pyt_pagersubprocessTs"%cCs0tjdkrt||�n
t||�dS(Nii(ii(Rtversion_infoR3R!(RR((s//sys/lib/python2.7/site-packages/hgext/pager.pyt	_runpagerhscCs@dtjks|j�r dSd�}tjtd|�dS(Ns
--debuggerc		Ss|jddtjjd��}|r|jddt�}|ddk}tj|d�}|s�|r||ks�||jdd�kr|r|jdd|j	��|jddt
�tjtd	�r�jtj
tj�nt||�qn|||||�S(
NR)tPAGERtattendtautotignoreRt	formattedtinteractivetSIGPIPE(tconfigR	tenvirontgett
configlisttattendedRt	parseboolt	setconfigR:tFalseRR&R<tSIG_DFLR5(	torigRtoptionstcmdtcmdfuncRR7R8talways((s//sys/lib/python2.7/site-packages/hgext/pager.pytpagecmdus!t_runcommand(RtargvR:RtwrapfunctionR(RRK((s//sys/lib/python2.7/site-packages/hgext/pager.pytuisetupqs	cCs/tjjdddtd�td�f�dS(NtR)R8s2when to paginate (boolean, always, auto, or never)tTYPE(Rt
globaloptstappendR(R((s//sys/lib/python2.7/site-packages/hgext/pager.pytextsetup�s			tannotatetcattdifftexporttglogtlogtqdiff(t__doc__R1RR	R&R+RRt	mercurialRRRRtmercurial.i18nRt
testedwithR!R3R5RORTRA(((s//sys/lib/python2.7/site-packages/hgext/pager.pyt<module>0sT"						

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.