[Python-checkins] python/nondist/sandbox/csv csv.py,1.2,1.3

davecole@users.sourceforge.net davecole@users.sourceforge.net
Thu, 30 Jan 2003 04:20:57 -0800


Update of /cvsroot/python/python/nondist/sandbox/csv
In directory sc8-pr-cvs1:/tmp/cvs-serv32119

Modified Files:
	csv.py 
Log Message:
Brought dialect specification in line with the PEP.
Did not touch the treatment of the dialect argument to the reader/writer
to match the PEP since I am not sure we have consensus yet.


Index: csv.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/csv/csv.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** csv.py	29 Jan 2003 14:18:20 -0000	1.2
--- csv.py	30 Jan 2003 12:20:54 -0000	1.3
***************
*** 2,9 ****
  
  class excel2000:
!     pass
  
  class excel2000_tab:
!     field_sep='\t'
  
  dialects = {
--- 2,14 ----
  
  class excel2000:
!     quotechar = '"'
!     delimiter = ','
!     escapechar = None
!     skipinitialspace = False
!     lineterminator = '\r\n'
!     quoting = 'minimal'
  
  class excel2000_tab:
!     delimiter = '\t'
  
  dialects = {
***************
*** 13,16 ****
--- 18,27 ----
      'excel2000-tab': excel2000_tab,
  }
+ 
+ def set_dialect(name, dialect):
+     dialects[name] = dialect
+ 
+ def get_dialect(name):
+     return dialects[name]
  
  class Error(Exception):