0
|
1 #!/usr/bin/env python
|
|
2 # -*- coding: utf-8 -*-
|
|
3
|
|
4 """
|
|
5 package to shape text blocks
|
|
6 """
|
|
7
|
|
8 import optparse
|
|
9 import os
|
|
10 import subprocess
|
|
11 import sys
|
3
|
12 import time
|
0
|
13
|
|
14 def add_options(parser):
|
|
15 """add options to the OptionParser instance"""
|
|
16
|
|
17 def main(args=sys.argv[1:]):
|
|
18
|
|
19 # parse command line options
|
|
20 usage = '%prog [options] ...'
|
|
21 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter):
|
|
22 """description formatter for console script entry point"""
|
|
23 def format_description(self, description):
|
|
24 if description:
|
|
25 return description.strip() + '\n'
|
|
26 else:
|
|
27 return ''
|
|
28 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
|
|
29 options, args = parser.parse_args(args)
|
|
30
|
3
|
31 # read from stdin
|
|
32 content = sys.stdin.read()
|
|
33
|
|
34 # print formatted content
|
|
35 print content
|
|
36
|
|
37 while True:
|
|
38 time.sleep(1) # XXX
|
|
39
|
0
|
40 if __name__ == '__main__':
|
|
41 main()
|
|
42
|