File: //usr/lib/python2.7/dist-packages/hgext/pager.pyc
ó
ÛXc @@ sÊ d Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l
m Z m Z m
Z
m Z m Z d Z d „ Z d „ Z d „ Z d
d d d
d d d g Z d S( s= browse 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.
Lastly, you can enable and disable paging for individual commands with
the attend-<command> option. This setting takes precedence over
existing attend and ignore options and defaults::
[pager]
attend-cat = false
To ignore global commands like :hg:`version` or :hg:`help`, you have
to specify them in your user configuration file.
To control whether the pager is used at all for an individual command,
you can use --pager=<value>::
- use as needed: `auto`.
- require the pager: `yes` or `on`.
- suppress the pager: `no` or `off` (any unrecognized value
will also work).
i ( t absolute_importN( t _( t cmdutilt commandst dispatcht
extensionst utils ships-with-hg-corec @ s4 t j | d t d d d t j d t j d t j d t j ƒ‰ ˆ j ‰ t j ‰ t
j t j j ƒ ƒ ‰ t
j t j j ƒ ƒ ‰ t
j
t j j ƒ d d ƒ ˆ _ t _ ‰ t
j ˆ j j ƒ t j j ƒ ƒ ˆ j t j ƒ rt
j ˆ j j ƒ t j j ƒ ƒ n t j ‡ ‡ ‡ ‡ ‡ ‡ ‡ f d
† ƒ } d S( Nt shellt bufsizeiÿÿÿÿt close_fdst stdint stdoutt stderrt wbi c @ s” t j t d ƒ r+ t j t j t j ƒ n ˆ j j ƒ ˆ ˆ _ ˆ t _ ˆ j ƒ t
j ˆ t j j ƒ ƒ t
j ˆ t j
j ƒ ƒ ˆ j ƒ d S( Nt SIGINT( R t safehasattrt signalR t SIG_IGNR
t closet foutt sysR t ost dup2t filenoR t wait( ( t newstdoutt oldstdoutt olduifoutt pagert stderrfdt stdoutfdt ui( s/ /usr/lib/python2.7/dist-packages/hgext/pager.pyt killpagere s
( t
subprocesst Popent TrueR t closefdst PIPER R R R R t dupR t fdopenR R
t _isattyt atexitt register( R t pR ( ( R R R R R R R s/ /usr/lib/python2.7/dist-packages/hgext/pager.pyt _runpagerT s ,"%c @ su d t j k s | j ƒ r d St j } d t j d g | ƒ k rI d Sd „ ‰ ‡ f d † } t j d | ƒ d S( Ns
--debuggert chgunixs --cmdserverc S@ sµ | j d d t j j d ƒ ƒ } t } t j | d ƒ } | d d k } | sS nÌ | rb t } n½ | sq t } n® | j d d t ƒ } | j d d ƒ }
t
j | t j
ƒ \ } } xi | D]a } d | }
| j d |
ƒ rò | j d |
ƒ } Pn | | k s| |
k rº | rº t } Pqº qº Wt | d | ƒ | r¢| j d d | j ƒ d ƒ | j d d
t d ƒ t j t d ƒ r’t j t j t j ƒ n t | | ƒ n | | | | | ƒ S( NR t PAGERt autot attendt ignores attend-%st pageractiveR t formattedt interactivet SIGPIPE( t configR t environt gett FalseR t parseboolR# t
configlistt attendedR t findcmdR t tablet
configboolt setattrt setconfigR3 R R R5 t SIG_DFLR, ( t origR t optionst cmdt cmdfuncR+ t usepagert alwaysR/ R0 R1 t cmdsR t var( ( s/ /usr/lib/python2.7/dist-packages/hgext/pager.pyt pagecmd} s<