'find reasonable way to display text'

def pager(self, text):

    if (not sys.stdout.isatty()):
        display.display(text, screen_only=True)
    elif ('PAGER' in os.environ):
        if (sys.platform == 'win32'):
            display.display(text, screen_only=True)
        else:
            self.pager_pipe(text, os.environ['PAGER'])
    else:
        p = subprocess.Popen('less    --version', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        p.communicate()
        if (p.returncode == 0):
            self.pager_pipe(text, 'less')
        else:
            display.display(text, screen_only=True)
