pdk.Util ($Date: 2002/12/04 08:04:30 $)
index
pdk/Util/__init__.py

Various utility routines. Exports all published identifiers from the modules defined in this sub-package (via the __all__ attribute mechanism).

FOG 05.2000

 
Package Contents
            
FileUtils
PyUtils
TextUtils
Util
__init__
observer
weakMethod
 
Classes
            
pdk.Util.TextUtils._StringFormatter
 
class _StringFormatter
     
Purpose:parsing, converting, and pretty-formatting of field-delimited and general strings

 
   Methods defined here:
__init__(self, **optionD)
floatFormat(self, inFloat, colWidth=None, precision=None, expFlag=None)
produces a string from inFloat of width colWidth with precision numbers of digits, if possible. If expFlag is True, or if the requested width cannot be achieved with plain formatting, scientific notation is used.
floatFormatArray(self, inArray, colWidth=None, precision=None, expFlag=None)
getAllowNA(self)
getColumnWidth(self)
getExpFlag(self)
getFieldDelimiter(self)
getIndent(self)
getIndentFirstLine(self)
getLineWidth(self)
getMaxStringLength(self)
getPrecision(self)
getStringDelimiter(self)
indentParagraph = wrapString(self, inString, indent=None, lineWidth=None, indentFirstLine=None)
intFormat(self, inInt, colWidth=None, expFlag=None)
produces a string from inInt of width colWidth. If expFlag is True, or if the requested width cannot be achieved with plain formatting, scientific notation is used. inInt can be either of types.IntType or of types.LongType (in the latter case, the trailing L is NOT printed).
intFormatArray(self, inArray, colWidth=None, expFlag=None)
objectFormat(self, object, lineWidth=None)
reset(self, precision=4, expFlag=0, lineWidth=40, colWidth=40, indent=15, indentFirstLine=0, maxStringLength=500, stringDelimiter=None, fieldDelimiter=None)
setAllowNA(self, flag)
setColumnWidth(self, value)
setExpFlag(self, value)
setFieldDelimiter(self, value)
setIndent(self, value)
setIndentFirstLine(self, value)
setLineWidth(self, value)
setMaxStringLength(self, value)
setPrecision(self, value)
setStringDelimiter(self, value)
stringConvert(self, inString)
converts field values in delimited data input files: * convert double quoted strings into single quoted strings * escape mid-string standard string delimiters
stringConvertLine(self, line, safe=1)
parses lines of field values delmited by self.fieldDelimiter and maps stringConvert on the resulting list. This is complicated, if field delimiters are allowed to occur within strings; in this case (safe set to 1), a second pass is made through the splitted input line, splicing open strings together.
stringFormat(self, inString, colWidth=None, pad=1)
this formats inString to be of colWidth width, either by cutting (putting two dots at the center to indicate the missing bit) or by left-aligning.
stringFormatArray(self, inArray, colWidth=None)
stringTable(self, stringL, indent=None, lineWidth=None, indentFirstLine=None, separator=' , ')
formats the strings passed in stringL to a table of width self.lineWidth, with an indent of self.indent. The column width is set to the maximum string width.
wrapString(self, inString, indent=None, lineWidth=None, indentFirstLine=None)
(word-)wraps inString to fit self.lineWidth with self.indent indentation.

Data and non-method functions defined here:
FIELDDELIMITER = ';'
STRINGDELIMITER = '"'
 
Data
             __author__ = '$Author: gathmann $'
__date__ = '$Date: 2002/12/04 08:04:30 $'
__path__ = ['/usr/local/lib/python2.2/site-packages/pdk/Util']
__revision__ = '$Revision: 1.16 $'
__source__ = '$Source: /home/cvs/pdk/pdk/Util/__init__.py,v $'
formatter = instance of _StringFormatter
 
Author
            
$Author: gathmann $