/usr/lib64/python2.6/site-packages/mx/Misc
Edit: /usr/lib64/python2.6/site-packages/mx/Misc/CSV.pyo (18144B)
Ñò
ÄÅVHc
@ sÎ d Z d Z d a d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k l
Z
d e i f d „ ƒ YZ d f d „ ƒ YZ
d
f d „ ƒ YZ d „ Z e d
j o e ƒ n d S( s CSV (Comma Separated Values) table format reader/writer.
The two classes read and write CSV data. It's a fairly simple
format for data exchange with nearly all spreadsheets, databases,
organizers, etc.
The reader class is built to be easy on the data passed in: small
errors like missing commas don't cause an exception (but do set a
variable to indicate this). Data is converted from CSV text into a
an internal format which can then be extracted into different
forms of table representation.
The writer writes standard CSV files and knows about quoting
rules, separator handling etc. so that interfacing to spreadsheets
and databases should pose no problem.
Both classes can be subclassed to enhance/modify their behaviour.
Copyright (c) 2000-2005, Marc-Andre Lemburg; mailto:mal@lemburg.com
Copyright (c) 2000-2008, eGenix.com Software GmbH; mailto:info@egenix.com
See the documentation for further information on copyrights,
or contact the author. All Rights Reserved.
s 1.0i iÿÿÿÿN( t TextToolst Errorc B s e Z RS( ( t __name__t
__module__( ( ( s1 /usr/lib64/python2.6/site-packages/mx/Misc/CSV.pyR ! s t Readerc B s e Z d Z d Z d Z d Z d Z d Z e i
d e d ƒ Z d d „ Z d „ Z
d d e i d „ Z d d d „ Z d „ Z d
„ Z d „ Z d „ Z d
„ Z e i e i e i d „ Z d d „ Z e i d „ Z e i d „ Z! d „ Z" d „ Z# RS( i s ,; s "([^"]|"")*"|[^"s
\015\012]*c C s/ | d j o t i d | d ƒ | _ n d S( Ns "([^"]|"")*"|[^"s
\015\012]*( t Nonet ret compilet parseitem( t selft
separators( ( s1 /usr/lib64/python2.6/site-packages/mx/Misc/CSV.pyt __init__C s
c C s( d | _ d | _ d | _ d | _ d S( s+ Empty the object and reset errors
i N( R t linest widtht errorst columns( R ( ( s1 /usr/lib64/python2.6/site-packages/mx/Misc/CSV.pyt flushI s i c C s… t | ƒ | j o t | d ƒ } n | i ƒ } | i ƒ | i | ƒ | _ | o | i ƒ n | d j o | i | ƒ n d S( s· Read a file.
If header is true (default), the first line of input is
interpreted as list of column names.
If columns is given as list of strings, these columns
names are used.
If both header and columns are used, columns overrides the
columns set by reading the header line. This is useful to
override header information from the input data.
t rbN( t typet opent readt closet _decodeR t process_headerR t set_columns( R t filet headerR t
StringTypet text( ( s1 /usr/lib64/python2.6/site-packages/mx/Misc/CSV.pyt loadR s
c C sI | i | ƒ | _ | o | i ƒ n | d j o | i | ƒ n d S( s¾ Read the given text
If header is true (default), the first line of input is
interpreted as list of column names.
If columns is given as list of strings, these columns
names are used.
If both header and columns are used, columns overrides the
columns set by reading the header line. This is useful to
override header information from the input data.
N( R R R R R ( R R R R ( ( s1 /usr/lib64/python2.6/site-packages/mx/Misc/CSV.pyt loadsm s
c C s | i } | i } d g t | ƒ } xc t | ƒ D]U \ } } | } t | ƒ | j o% d g | t | ƒ | t | ƒ )n | | |