Mercurial > hg > TextShaper
diff textshaper/main.py @ 0:53cfd6e1ad0f
initial commit,
from http://k0s.org/portfolio/ideas/textshaper.py ,
see also http://k0s.org/portfolio/ideas/cleanuptext.py
So you have a block of text ... What do you want to do with it?!? ==
Desired Functionality == == Previous work == /corpus of past programs
-> consolidate/ - onelineit - quoting - dequoting (including e.g. +/-,
diff-ish shit) - removing timestamps - removing/adding irc quote tags
Interface: - library code - (n)curses - javascript/REST Consider the
pattern: * things that add and/or remove a thing * things that alter
spacing == Reference == Previous k0s.ware (big and small): -
http://k0s.org/hg/config/rev/5e0b4ec36013 Highly related (~>
identity): http://k0s.org/portfolio/ideas/cleanuptext.py Ubuntu
packages: - par (paragraph reformatter)
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 10 Aug 2013 15:47:30 -0700 |
parents | |
children | 925a7959cd0b |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/textshaper/main.py Sat Aug 10 15:47:30 2013 -0700 @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +package to shape text blocks +""" + +import optparse +import os +import subprocess +import sys + +def add_options(parser): + """add options to the OptionParser instance""" + +def main(args=sys.argv[1:]): + + # parse command line options + usage = '%prog [options] ...' + class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): + """description formatter for console script entry point""" + def format_description(self, description): + if description: + return description.strip() + '\n' + else: + return '' + parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) + options, args = parser.parse_args(args) + +if __name__ == '__main__': + main() +