Message9007

Author girish946
Recipients girish946, kanglecjr, zyasoft
Date 2014-09-19.18:41:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411152120.56.0.6290470584.issue2209@psf.upfronthosting.co.za>
In-reply-to
Content
help is not being displayed because
 os.environ.get('TERM') in ('dumb', 'emacs')
in getpager() function always return False as i don't have 'dumb' or 'emacs' terminal configured in my environment and that's why the help() does nothing.
i removed the " in ('dumb' , 'emacs' ) " part and help() is working fine.

now the getpager() looks like

def getpager():
    """Decide what method to use for paging through text."""
    if type(sys.stdout) is not types.FileType:
        return plainpager
    if not sys.stdin.isatty() or not sys.stdout.isatty():
        return plainpager
    if 'PAGER' in os.environ:
        if sys.platform == 'win32': # pipes completely broken in Windows
            return lambda text: tempfilepager(plain(text), os.environ['PAGER'])
        #elif os.environ.get('TERM') in ('dumb', 'emacs'):
        elif os.environ.get('TERM'):
            return lambda text: pipepager(plain(text), os.environ['PAGER'])
        else:
            return lambda text: pipepager(text, os.environ['PAGER'])
    #if os.environ.get('TERM') in ('dumb', 'emacs'):
    if os.environ.get('TERM'):
        return plainpager
    if sys.platform == 'win32' or sys.platform.startswith('os2'):
        return lambda text: tempfilepager(plain(text), 'more <')
    if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
        return lambda text: pipepager(text, 'less')
    import tempfile
    (fd, filename) = tempfile.mkstemp()
    os.close(fd)
    try:
        if hasattr(os, 'system') and os.system('more "%s"' % filename) == 0:
            return lambda text: pipepager(text, 'more')
        else:
            return ttypager
    finally:
        os.unlink(filename)
History
Date User Action Args
2014-09-19 18:42:00girish946setmessageid: <1411152120.56.0.6290470584.issue2209@psf.upfronthosting.co.za>
2014-09-19 18:42:00girish946setrecipients: + girish946, zyasoft, kanglecjr
2014-09-19 18:42:00girish946linkissue2209 messages
2014-09-19 18:42:00girish946create