'pipe text through a pager'

@staticmethod
def pager_pipe(text, cmd):

    if ('LESS' not in os.environ):
        os.environ['LESS'] = CLI.LESS_OPTS
    try:
        cmd = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=sys.stdout)
        cmd.communicate(input=to_bytes(text))
    except IOError:
        pass
    except KeyboardInterrupt:
        pass
