;ò ¤¥*Bc@sTdZdkZdklZdefd„ƒYZd„Zd„Zed„ZdS(s  Module providing common utilities for many 4Suite components, as well as for general use. Copyright 2005 Fourthought, Inc. (USA). Detailed license and copyright information: http://4suite.org/COPYRIGHT Project home, documentation, distributions: http://4suite.org/ N(s FtExceptions UriExceptioncBsYtZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d „ZRS( sA Exceptions used by the Uri module, and possibly others. idioipixiyi‚iÈiÉiÊi,iècOsjdk}|p|f|_||_|i}|p|}||||_ t i ||i |ƒdSdS(N( s MessageSourcesargsskwargssselfsparamss errorCodesURIsmessagessmsgargssmessages Exceptions__init__(sselfs errorCodesargsskwargssmsgargssmessagess MessageSource((sJ/mnt/gmirror/ports/textproc/py-4suite/work/4Suite-1.0b1/Ft/Lib/__init__.pys__init__)s    (s__name__s __module__s__doc__sINVALID_BASE_URIsRELATIVE_BASE_URIsOPAQUE_BASE_URIs NON_FILE_URIsUNIX_REMOTE_HOST_FILE_URIsRESOURCE_ERRORsSCHEME_REQUIREDsUNSUPPORTED_SCHEMEsIDNA_UNSUPPORTEDsINVALID_PUBLIC_ID_URNsUNSUPPORTED_PLATFORMs__init__(((sJ/mnt/gmirror/ports/textproc/py-4suite/work/4Suite-1.0b1/Ft/Lib/__init__.pys UriExceptions cCs/t|ƒ|jo|| dSn || SdS(s` Returns text truncated to length, with "..." appended if truncation was necessary. s...N(slenstextslength(stextslength((sJ/mnt/gmirror/ports/textproc/py-4suite/work/4Suite-1.0b1/Ft/Lib/__init__.pysTruncate4scCs t|d„|idƒƒSdS(sà A word-wrap function that preserves existing line breaks and most spaces in the text. Expects that existing line breaks are posix newlines (\n). See also: Ft.Lib.CommandLine.CommandLineUtil.wrap_text() cCsLd|dt|ƒ|idƒdt|iddƒdƒ|j|fS(Ns%s%s%ss s ii(slineslensrfindswordssplitswidth(slineswordswidth((sJ/mnt/gmirror/ports/textproc/py-4suite/work/4Suite-1.0b1/Ft/Lib/__init__.pysHss N(sreduceswidthstextssplit(stextswidth((sJ/mnt/gmirror/ports/textproc/py-4suite/work/4Suite-1.0b1/Ft/Lib/__init__.pysWrap?s cCsvt|dƒo |i}n|}t|dƒo |iƒodSny|iƒWn|oqn‚nXdSdS(sh Closes a stream, ignoring errors if quiet=True. If the stream is a terminal (e.g. sys.stdin, stdout, stderr), does not attempt to close the stream. Closing terminal streams could interfere with subsequent read or write attempts. For example, after calling sys.stdout.close(), subsequent writes to stdout will not raise an exception, but may also fail to actually write anything to stdout. The stream argument can be any Python file-like object with a close() method, such as a regular file object or an instance of Ft.Xml.InputSource.InputSource (or subclass thereof). sstreamsisattyN(shasattrsstreams raw_streamsisattysclosesquiet(sstreamsquiets raw_stream((sJ/mnt/gmirror/ports/textproc/py-4suite/work/4Suite-1.0b1/Ft/Lib/__init__.pys CloseStreamRs ( s__doc__sossFts FtExceptions UriExceptionsTruncatesWrapsFalses CloseStream(sTruncates CloseStreams FtExceptionsWrapsoss UriException((sJ/mnt/gmirror/ports/textproc/py-4suite/work/4Suite-1.0b1/Ft/Lib/__init__.pys? s   #