[Python-checkins] python/nondist/sandbox/csv csv.py,1.12,1.13
montanaro@users.sourceforge.net
montanaro@users.sourceforge.net
Sun, 02 Feb 2003 18:34:44 -0800
Update of /cvsroot/python/python/nondist/sandbox/csv
In directory sc8-pr-cvs1:/tmp/cvs-serv25115
Modified Files:
csv.py
Log Message:
set_dialect is a bad name. register_dialect is better.
Check that dialect being registered is subclass of Dialect.
save an instance of the class, not the class itself.
Index: csv.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/csv/csv.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** csv.py 2 Feb 2003 12:05:07 -0000 1.12
--- csv.py 3 Feb 2003 02:34:42 -0000 1.13
***************
*** 89,94 ****
pass
! def set_dialect(name, dialect):
! dialects[name] = dialect
def get_dialect(name):
--- 89,96 ----
pass
! def register_dialect(name, dialect):
! if not issubclass(dialect, Dialect):
! raise TypeError, "dialect not a subclass of Dialect"
! dialects[name] = dialect()
def get_dialect(name):