'Initialization of the text handler.
Args:
caller (Object or Player): Entity reading the text.
text (str): The text to put under paging.
always_page (bool, optional): If `False`, the
pager will only kick in if `text` is too big
to fit the screen.
session (Session, optional): If given, this session will be used
to determine the screen width and will receive all output.
justify_kwargs (dict, bool or None, optional): If given, this should
be valid keyword arguments to the utils.justify() function. If False,
no justification will be done.
exit_on_lastpage (bool, optional): If reaching the last page without the
page being completely filled, exit pager immediately. If unset,
another move forward is required to exit. If set, the pager
exit message will not be shown.
kwargs (any, optional): These will be passed on
to the `caller.msg` method.'

def __init__(self, caller, text, always_page=False, session=None, justify_kwargs=None, exit_on_lastpage=False, **kwargs):

    self._caller = caller
    self._kwargs = kwargs
    self._pages = []
    self._npages = []
    self._npos = []
    self.exit_on_lastpage = exit_on_lastpage
    self._exit_msg = 'Exited    |wmore|n    pager.'
    if (not session):
        sessions = caller.sessions.get()
        if (not sessions):
            return
        session = sessions[0]
    self._session = session
    height = max(4, (session.protocol_flags.get('SCREENHEIGHT', {0: _SCREEN_HEIGHT})[0] - 4))
    width = session.protocol_flags.get('SCREENWIDTH', {0: _SCREEN_WIDTH})[0]
    if (justify_kwargs is False):
        lines = text.split('\n')
    else:
        justify_kwargs = (justify_kwargs or {})
        width = justify_kwargs.get('width', width)
        justify_kwargs['width'] = width
        justify_kwargs['align'] = justify_kwargs.get('align', 'l')
        justify_kwargs['indent'] = justify_kwargs.get('indent', 0)
        lines = []
        for line in text.split('\n'):
            if (len(line) > width):
                lines.extend(justify(line, **justify_kwargs).split('\n'))
            else:
                lines.append(line)
    height = min((10000 // max(1, width)), height)
    self._pages = ['\n'.join(lines[i:(i + height)]) for i in range(0, len(lines), height)]
    self._npages = len(self._pages)
    self._npos = 0
    if ((self._npages <= 1) and (not always_page)):
        caller.msg(text=text, **kwargs)
    else:
        caller.ndb._more = self
        caller.cmdset.add(CmdSetMore)
        self.page_top()
