tabbedwriter: version=0.1 NAME: tabbedwriter.py SYNOPSIS: import tabbedwriter wr=tabbedwriter.TabbedWriter(myfile) DESCRIPTION: Inheritable (mixin) functionality for tab-indented writing. Normally for indentable files, e.g.: Indents are 4 space chars by default. OPTIONS: -h,--help this message -v,--version version -d,--debug turn on debug messages EXAMPLES: import tabbedwriter myfile=open('myfile.txt','w') tabbed_file=tabbedwriter.Tabbedwriter(myfile) def my_output(self,wr): out=wr.write;indent=wr.indent;undent=wr.undent out("Hello") indent() out("indented") undent() out("undented") out("start a line",nl=0) out("...and complete it",pad=0) myoutput(tabbed_file) # tabbedwriter.py # Copyright (C) 2001,2004 Harry George hgg9140@seanet.com # http://www.seanet.com/~hgg9140 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.