[Patches] [ python-Patches-612111 ] quietly select between 'less' and 'more'
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 24 Sep 2002 14:03:16 -0700
Patches item #612111, was opened at 2002-09-20 08:24
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=612111&group_id=5470
Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Neal Norwitz (nnorwitz)
Summary: quietly select between 'less' and 'more'
Initial Comment:
On Unixoid systems without the 'less' command, executing
'pydoc.help(mod)' emits:
sh: less: not found
which is annoying. The attached patch gets it to quietly look for 'less'
and 'more'. I don't know if the locateexe() function is entirely correct
(especially considering Windows) or if there are other pagers available.
backport candidate? I know this behavior exists in 2.1.3 and 2.2.1.
Dunno if it's more than a wart though.
----------------------------------------------------------------------
>Comment By: Skip Montanaro (montanaro)
Date: 2002-09-24 16:03
Message:
Logged In: YES
user_id=44345
skip> The attached patch gets it to quietly look for 'less'
ping> It also already does this.
Not quite. In situations where no PAGER was set and less was not
found, as I indicated it emitted "sh: less: not found". That was the entire
reason for submitting the patch. I'm more than willing to accept that my
patch was incomplete or incorrect in some way, but I was trying to
address the issue of pydoc noisily informing me that 'less' was not
available.
S
----------------------------------------------------------------------
Comment By: Ka-Ping Yee (ping)
Date: 2002-09-24 15:54
Message:
Logged In: YES
user_id=45338
> It should also honour the PAGER environment variable
It already does this. Read the code.
> I would suggest simply call more on Windows.
It already does this. Read the code.
> The attached patch gets it to quietly look for 'less'
It also already does this. If it's not working for you,
there must be a bug. Look at the code -- all of this
behaviour is right there in getpager() and has been
there ever since pydoc was first written.
----------------------------------------------------------------------
Comment By: Gerhard Häring (ghaering)
Date: 2002-09-24 13:36
Message:
Logged In: YES
user_id=163326
It should also honour the PAGER environment variable, and
use it if available. I'm trying to be puristic for a minute:
we probably shouldn't support any nonstandard pagers like
less, view, most, etc. at all. That's what Unix has the
PAGER environment variable for, just like the EDITOR and
VISUAL ones. I'm certainly no puristic Unix user, but we
already have zillions of patches for the webbrowser module
to support the various Unix Web Browsers out there. We
should avoid to get into the same situation with pydoc.
----------------------------------------------------------------------
Comment By: Gerhard Häring (ghaering)
Date: 2002-09-24 13:36
Message:
Logged In: YES
user_id=163326
It should also honour the PAGER environment variable, and
use it if available. I'm trying to be puristic for a minute:
we probably shouldn't support any nonstandard pagers like
less, view, most, etc. at all. That's what Unix has the
PAGER environment variable for, just like the EDITOR and
VISUAL ones. I'm certainly no puristic Unix user, but we
already have zillions of patches for the webbrowser module
to support the various Unix Web Browsers out there. We
should avoid to get into the same situation with pydoc.
----------------------------------------------------------------------
Comment By: Thomas Heller (theller)
Date: 2002-09-20 08:54
Message:
Logged In: YES
user_id=11105
locateexe does not work on Windows (for several reasons).
Dunno if people install other pagers - I certainly don't.
And when they do, are they really named 'less'?
OTOH, more is in the PATH on every windows system, so I
would suggest simply call more on Windows.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=612111&group_id=5470