# HG changeset patch # User Jeff Hammel # Date 1380066186 25200 # Node ID 26bb5e99f76c1e27374c314514c1ba5a28add5d8 # Parent 925a7959cd0b9afe98a34fde5bff9cde55f9949c textshaper/main.py diff -r 925a7959cd0b -r 26bb5e99f76c textshaper/main.py --- a/textshaper/main.py Mon Sep 23 00:04:00 2013 -0700 +++ b/textshaper/main.py Tue Sep 24 16:43:06 2013 -0700 @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- """ -package to shape text blocks +package to shape text blocks """ import optparse @@ -11,6 +11,12 @@ import sys import time +def display(content) + print content + print '--' + nlines = len(content.splitlines()) + print '%d lines' % nlines + def add_options(parser): """add options to the OptionParser instance""" @@ -32,7 +38,7 @@ content = sys.stdin.read() # print formatted content - print content + display(content) while True: time.sleep(1) # XXX