Esempio n. 1
0
def main():
    """
    Produce output and print to pager.
    """
    dummy = TextGen()
    print('')  # pylint: disable=C0325
    text_str = ''
    for _ in range(PARAS):
        pgraph = Paragraph(dummy.chunk(), int(Cli.width() * 0.6), True)
        pgraph.set_lmargin(Cli.width() // 5)
        text_str += str(pgraph)
    if PAGER is True:
        Cli.less(text_str)
    else:
        print(text_str)  # pylint: disable=C0325
Esempio n. 2
0
"""A test of the Cli.tty method.  Writes text to the screen one char at a time,
like a teletype.

*alter Cli.tty() so that it automatically wraps text."""

import datetime
import textwrap

import cjh.cli as cli
from cjh.text_fill import TextGen

__author__ = 'Chris Horn <*****@*****.**>'
__license__ = 'GPL'

STRING = textwrap.fill(
        TextGen.chunk(),
        width=60,
        initial_indent=' ' * 5,
        subsequent_indent=' ' * 5)


def main():
    """
    Prints date and then a chunk of filler text.  Text "streams" onto
    the screen.
    """
    print('\n')  # pylint: disable=C0325
    today = datetime.datetime.today()
    now = today.strftime('%c')  # Make syre this is a portable date format.
    cli.tty(' ' * 35 + now)
    print('\n' * 2)  # pylint: disable=C0325