--- setup.py.orig 2004-02-04 22:25:11.507290503 -0500 +++ setup.py 2004-02-04 22:25:36.831750000 -0500 @@ -49,15 +49,15 @@ self.announce("Pre-release checks pass!") sdist.run(self) -setup(name = "csv", +setup(name = "csv2", version = "1.0", maintainer = "Dave Cole", maintainer_email = " csv@object-craft.com.au", description = "Fast CSV Parser for Python", url = "http://www.object-craft.com.au/projects/csv/", ext_modules = [ - Extension('csv', - ['csv.c'], + Extension('csv2', + ['csv.c'], ) ], license = 'BSD - see file LICENCE', --- test.py.orig 2004-02-04 22:25:46.309424965 -0500 +++ test.py 2004-02-04 22:26:06.421613162 -0500 @@ -24,12 +24,12 @@ plat_spec = "lib.%s-%s" % (distutils.util.get_platform(), sys.version[0:3]) sys.path.insert(0, os.path.join(basedir, 'build', plat_spec)) import unittest -import csv +import csv2 import string class TestCSVParse(unittest.TestCase): def parse_expect(self, input, expected_result, **kw): - parser = csv.parser() + parser = csv2.parser() for kw_arg, kw_value in kw.items(): setattr(parser, kw_arg, kw_value) result = [] @@ -41,7 +41,7 @@ self.assertEqual(expected_result, result) def parse_exception(self, input, exception, **kw): - parser = csv.parser() + parser = csv2.parser() for kw_arg, kw_value in kw.items(): setattr(parser, kw_arg, kw_value) self.assertRaises(exception, parser.parse, input) @@ -116,10 +116,10 @@ ['9','8','7','6']]) def test_strict_quote(self): - self.parse_exception('"abc"def', csv.Error, strict = 1) + self.parse_exception('"abc"def', csv2.Error, strict = 1) def test_unquoted_nl(self): - self.parse_exception('abc\ndef', csv.Error) + self.parse_exception('abc\ndef', csv2.Error) def test_alt_fieldsep(self): self.parse_expect('1\t2\t3\t', [['1', '2', '3', '']], @@ -151,7 +151,7 @@ class TestCSVJoin(unittest.TestCase): def join_expect(self, input, expected_result, **kw): - parser = csv.parser() + parser = csv2.parser() for kw_arg, kw_value in kw.items(): setattr(parser, kw_arg, kw_value) result = parser.join(input) --- csv.c.orig 2004-02-04 22:24:59.000000000 -0500 +++ csv.c 2004-02-04 22:42:45.094982901 -0500 @@ -726,7 +726,7 @@ " Extracts fields from the (partial) CSV record in string.\n" " Trailing end of line characters are ignored, so you do not\n" " need to strip the string before passing it to the parser. If\n" -" you pass more than a single line of text, a csv.Error\n" +" you pass more than a single line of text, a csv2.Error\n" " exception will be raised.\n" "\n" " join(sequence) -> string\n" @@ -735,8 +735,8 @@ "\n" "Typical usage:\n" "\n" -" import csv\n" -" p = csv.parser()\n" +" import csv2\n" +" p = csv2.parser()\n" " file = open('afile.csv')\n" " while 1:\n" " line = file.readline()\n" @@ -748,13 +748,13 @@ " continue\n" " # process the fields\n"; -void initcsv(void) +void initcsv2(void) { PyObject *module, *dict, *rev = NULL; ParserType.ob_type = &PyType_Type; /* Create the module and add the functions */ - module = Py_InitModule4("csv", csv_methods, + module = Py_InitModule4("csv2", csv_methods, csv_module__doc__, (PyObject*)NULL,PYTHON_API_VERSION); if (module == NULL) @@ -769,7 +769,7 @@ goto error; /* Add the CSV exception object to the module. */ - if ((error_obj = PyErr_NewException("csv.Error", NULL, NULL)) == NULL) + if ((error_obj = PyErr_NewException("csv2.Error", NULL, NULL)) == NULL) goto error; PyDict_SetItemString(dict, "Error", error_obj); @@ -779,5 +779,5 @@ Py_XDECREF(error_obj); /* Check for errors */ if (PyErr_Occurred()) - Py_FatalError("can't initialize module csv"); + Py_FatalError("can't initialize module csv2"); }