Commits

Lenard Lindstrom committed 88612bd

Remove redundant prefix from buftools.BufferImporter and BufferExporter

Comments (0)

Files changed (6)

test/base_test.py

 
     def NEWBUF_assertSame(self, proxy, exp):
         buftools = self.buftools
+        Importer = buftools.Importer
         self.assertEqual(proxy.length, exp.len)
-        imp = buftools.BufferImporter(proxy, buftools.PyBUF_RECORDS_RO)
+        imp = Importer(proxy, buftools.PyBUF_RECORDS_RO)
         try:
             self.assertEqual(imp.readonly, exp.readonly)
             self.assertEqual(imp.format, exp.format)
     def NEWBUF_test_newbuf(self):
         from pygame.bufferproxy import BufferProxy
 
-        Exporter = self.buftools.BufferExporter
+        Exporter = self.buftools.Exporter
         _shape = [2, 3, 5, 7, 11]  # Some prime numbers
         for ndim in range(1, len(_shape)):
             o = Exporter(_shape[0:ndim], '=h')
         is_lil_endian = pygame.get_sdl_byteorder() == pygame.LIL_ENDIAN
         fsys, frev = ('<', '>') if is_lil_endian else ('>', '<')
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
         a = BufferProxy({'typestr': '|u4',
                          'shape': (10, 2),
                          'data': (9, False)}) # 9? No data accesses.
-        b = BufferImporter(a, buftools.PyBUF_SIMPLE)
+        b = Importer(a, buftools.PyBUF_SIMPLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, 9)
-        b = BufferImporter(a, buftools.PyBUF_WRITABLE)
+        b = Importer(a, buftools.PyBUF_WRITABLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, 9)
-        b = BufferImporter(a, buftools.PyBUF_ND)
+        b = Importer(a, buftools.PyBUF_ND)
         self.assertEqual(b.ndim, 2)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
                          'shape': (5, 10),
                          'strides': (24, 2),
                          'data': (42, False)}) # 42? No data accesses.
-        b = BufferImporter(a, buftools.PyBUF_STRIDES)
+        b = Importer(a, buftools.PyBUF_STRIDES)
         self.assertEqual(b.ndim, 2)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, 100)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, 42)
-        b = BufferImporter(a, buftools.PyBUF_FULL_RO)
+        b = Importer(a, buftools.PyBUF_FULL_RO)
         self.assertEqual(b.ndim, 2)
         self.assertEqual(b.format, '=h')
         self.assertEqual(b.len, 100)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, 42)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_SIMPLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_ND)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_SIMPLE)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_ND)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_ANY_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_CONTIG)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_SIMPLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_ND)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_CONTIG)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_SIMPLE)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_ND)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_ANY_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_CONTIG)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_CONTIG)
         a = BufferProxy({'typestr': frev + 'i2',
                          'shape': (3, 5, 10),
                          'strides': (120, 24, 2),
                          'data': (1000000, True)}) # 1000000? No data accesses.
-        b = BufferImporter(a, buftools.PyBUF_FULL_RO)
+        b = Importer(a, buftools.PyBUF_FULL_RO)
         self.assertEqual(b.ndim, 3)
         self.assertEqual(b.format, frev + 'h')
         self.assertEqual(b.len, 300)
         self.assertTrue(b.suboffsets is None)
         self.assertTrue(b.readonly)
         self.assertEqual(b.buf, 1000000)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_FULL)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_FULL)
 
     def NEWBUF_test_PgObject_AsBuffer_PyBUF_flags(self):
         from pygame.bufferproxy import BufferProxy
         is_lil_endian = pygame.get_sdl_byteorder() == pygame.LIL_ENDIAN
         fsys, frev = ('<', '>') if is_lil_endian else ('>', '<')
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
         e = arrinter.Exporter((10, 2), typekind='f',
                               itemsize=ctypes.sizeof(ctypes.c_double))
         a = BufferProxy(e)
-        b = BufferImporter(a, buftools.PyBUF_SIMPLE)
+        b = Importer(a, buftools.PyBUF_SIMPLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, e.len)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, e.data)
-        b = BufferImporter(a, buftools.PyBUF_WRITABLE)
+        b = Importer(a, buftools.PyBUF_WRITABLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, e.len)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, e.data)
-        b = BufferImporter(a, buftools.PyBUF_ND)
+        b = Importer(a, buftools.PyBUF_ND)
         self.assertEqual(b.ndim, e.nd)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         e = arrinter.Exporter((5, 10), typekind='i', itemsize=2,
                               strides=(24, 2))
         a = BufferProxy(e)
-        b = BufferImporter(a, buftools.PyBUF_STRIDES)
+        b = Importer(a, buftools.PyBUF_STRIDES)
         self.assertEqual(b.ndim, e.nd)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, e.len)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, e.data)
-        b = BufferImporter(a, buftools.PyBUF_FULL_RO)
+        b = Importer(a, buftools.PyBUF_FULL_RO)
         self.assertEqual(b.ndim, e.nd)
         self.assertEqual(b.format, '=h')
         self.assertEqual(b.len, e.len)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, e.data)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_SIMPLE)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_SIMPLE)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_WRITABLE)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_WRITABLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_ND)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_ND)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_ANY_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_CONTIG)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_SIMPLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_ND)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_CONTIG)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_SIMPLE)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_ND)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_ANY_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_CONTIG)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_CONTIG)
         e = arrinter.Exporter((3, 5, 10), typekind='i', itemsize=2,
                               strides=(120, 24, 2),
                               flags=arrinter.PAI_ALIGNED)
         a = BufferProxy(e)
-        b = BufferImporter(a, buftools.PyBUF_FULL_RO)
+        b = Importer(a, buftools.PyBUF_FULL_RO)
         self.assertEqual(b.ndim, e.nd)
         self.assertEqual(b.format, frev + 'h')
         self.assertEqual(b.len, e.len)
         self.assertTrue(b.suboffsets is None)
         self.assertTrue(b.readonly)
         self.assertEqual(b.buf, e.data)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_FULL)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_FULL)
 
     def test_PgObject_GetBuffer_exception(self):
         # For consistency with surfarray

test/bufferproxy_test.py

         from ctypes import string_at
 
         buftools = self.buftools
-        exp = buftools.BufferExporter((10,), 'B', readonly=True)
+        Exporter = buftools.Exporter
+        Importer = buftools.Importer
+        exp = Exporter((10,), 'B', readonly=True)
         b = BufferProxy(exp)
         self.assertEqual(b.length, exp.len)
         self.assertEqual(b.raw, string_at(exp.buf, exp.len))
             self.assertEqual(d['data'], (exp.buf, True))
         finally:
             d = None
-        exp = buftools.BufferExporter((3,), '=h')
+        exp = Exporter((3,), '=h')
         b = BufferProxy(exp)
         self.assertEqual(b.length, exp.len)
         self.assertEqual(b.raw, string_at(exp.buf, exp.len))
         finally:
             d = None
 
-        exp = buftools.BufferExporter((10, 2), '=i')
+        exp = Exporter((10, 2), '=i')
         b = BufferProxy(exp)
-        imp = buftools.BufferImporter(b, buftools.PyBUF_RECORDS)
+        imp = Importer(b, buftools.PyBUF_RECORDS)
         self.assertTrue(imp.obj is b)
         self.assertEqual(imp.buf, exp.buf)
         self.assertEqual(imp.ndim, exp.ndim)
              'strides': (1,),
              'data': (9, True)} # 9? Will not reading the data anyway.
         b = BufferProxy(d)
-        imp = buftools.BufferImporter(b, buftools.PyBUF_SIMPLE)
+        imp = Importer(b, buftools.PyBUF_SIMPLE)
         self.assertTrue(imp.obj is b)
         self.assertEqual(imp.buf, 9)
         self.assertEqual(imp.len, 10)

test/mixer_test.py

                    64: '=Q', -64: '=q'}
         format = formats[fmt]
         buftools = self.buftools
-        BufferExporter = buftools.BufferExporter
-        BufferImporter = buftools.BufferImporter
+        Exporter = buftools.Exporter
+        Importer = buftools.Importer
         is_lil_endian = pygame.get_sdl_byteorder() == pygame.LIL_ENDIAN
         fsys, frev = ('<', '>') if is_lil_endian else ('>', '<')
         shape = (10, channels)[:ndim]
         strides = (channels * itemsize, itemsize)[2 - ndim:]
-        exp = BufferExporter(shape, format=frev + 'i')
+        exp = Exporter(shape, format=frev + 'i')
         snd = mixer.Sound(array=exp)
         buflen = len(exp) * itemsize * channels
-        imp = BufferImporter(snd, buftools.PyBUF_SIMPLE)
+        imp = Importer(snd, buftools.PyBUF_SIMPLE)
         self.assertEqual(imp.ndim, 0)
         self.assertTrue(imp.format is None)
         self.assertEqual(imp.len, buflen)
         self.assertTrue(imp.suboffsets is None)
         self.assertFalse(imp.readonly)
         self.assertEqual(imp.buf, snd._samples_address)
-        imp = BufferImporter(snd, buftools.PyBUF_WRITABLE)
+        imp = Importer(snd, buftools.PyBUF_WRITABLE)
         self.assertEqual(imp.ndim, 0)
         self.assertTrue(imp.format is None)
         self.assertEqual(imp.len, buflen)
         self.assertTrue(imp.suboffsets is None)
         self.assertFalse(imp.readonly)
         self.assertEqual(imp.buf, snd._samples_address)
-        imp = BufferImporter(snd, buftools.PyBUF_FORMAT)
+        imp = Importer(snd, buftools.PyBUF_FORMAT)
         self.assertEqual(imp.ndim, 0)
         self.assertEqual(imp.format, format)
         self.assertEqual(imp.len, buflen)
         self.assertTrue(imp.suboffsets is None)
         self.assertFalse(imp.readonly)
         self.assertEqual(imp.buf, snd._samples_address)
-        imp = BufferImporter(snd, buftools.PyBUF_ND)
+        imp = Importer(snd, buftools.PyBUF_ND)
         self.assertEqual(imp.ndim, ndim)
         self.assertTrue(imp.format is None)
         self.assertEqual(imp.len, buflen)
         self.assertTrue(imp.suboffsets is None)
         self.assertFalse(imp.readonly)
         self.assertEqual(imp.buf, snd._samples_address)
-        imp = BufferImporter(snd, buftools.PyBUF_STRIDES)
+        imp = Importer(snd, buftools.PyBUF_STRIDES)
         self.assertEqual(imp.ndim, ndim)
         self.assertTrue(imp.format is None)
         self.assertEqual(imp.len, buflen)
         self.assertTrue(imp.suboffsets is None)
         self.assertFalse(imp.readonly)
         self.assertEqual(imp.buf, snd._samples_address)
-        imp = BufferImporter(snd, buftools.PyBUF_FULL_RO)
+        imp = Importer(snd, buftools.PyBUF_FULL_RO)
         self.assertEqual(imp.ndim, ndim)
         self.assertEqual(imp.format, format)
         self.assertEqual(imp.len, buflen)
         self.assertTrue(imp.suboffsets is None)
         self.assertFalse(imp.readonly)
         self.assertEqual(imp.buf, snd._samples_address)
-        imp = BufferImporter(snd, buftools.PyBUF_FULL_RO)
+        imp = Importer(snd, buftools.PyBUF_FULL_RO)
         self.assertEqual(imp.ndim, ndim)
         self.assertEqual(imp.format, format)
         self.assertEqual(imp.len, buflen)
         self.assertTrue(imp.suboffsets is None)
         self.assertFalse(imp.readonly)
         self.assertEqual(imp.buf, snd._samples_address)
-        imp = BufferImporter(snd, buftools.PyBUF_C_CONTIGUOUS)
+        imp = Importer(snd, buftools.PyBUF_C_CONTIGUOUS)
         self.assertEqual(imp.ndim, ndim)
         self.assertTrue(imp.format is None)
         self.assertEqual(imp.strides, strides)
-        imp = BufferImporter(snd, buftools.PyBUF_ANY_CONTIGUOUS)
+        imp = Importer(snd, buftools.PyBUF_ANY_CONTIGUOUS)
         self.assertEqual(imp.ndim, ndim)
         self.assertTrue(imp.format is None)
         self.assertEqual(imp.strides, strides)
         if (ndim == 1):
-            imp = BufferImporter(snd, buftools.PyBUF_F_CONTIGUOUS)
+            imp = Importer(snd, buftools.PyBUF_F_CONTIGUOUS)
             self.assertEqual(imp.ndim, 1)
             self.assertTrue(imp.format is None)
             self.assertEqual(imp.strides, strides)
         else:
-            self.assertRaises(BufferError, BufferImporter, snd,
+            self.assertRaises(BufferError, Importer, snd,
                               buftools.PyBUF_F_CONTIGUOUS)
 
     def test_get_raw(self):

test/pixelarray_test.py

 
     def NEWBUF_test_newbuf_2D (self):
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
 
         for bit_size in [8, 16, 24, 32]:
             s = pygame.Surface ((10, 2), 0, bit_size)
             w, h = shape
             strides = ar.strides
             length = w * h * itemsize
-            imp = BufferImporter (ar, buftools.PyBUF_FULL)
+            imp = Importer (ar, buftools.PyBUF_FULL)
             self.assertTrue (imp.obj, ar)
             self.assertEqual (imp.len, length)
             self.assertEqual (imp.ndim, 2)
         w, h = shape
         strides = ar.strides
         length = w * h * itemsize
-        imp = BufferImporter (ar, buftools.PyBUF_SIMPLE)
+        imp = Importer (ar, buftools.PyBUF_SIMPLE)
         self.assertTrue (imp.obj, ar)
         self.assertEqual (imp.len, length)
         self.assertEqual (imp.ndim, 0)
         self.assertTrue (imp.strides is None)
         self.assertTrue (imp.suboffsets is None)
         self.assertEqual (imp.buf, s._pixels_address)
-        imp = BufferImporter (ar, buftools.PyBUF_FORMAT)
+        imp = Importer (ar, buftools.PyBUF_FORMAT)
         self.assertEqual (imp.ndim, 0)
         self.assertEqual (imp.format, format)
-        imp = BufferImporter (ar, buftools.PyBUF_WRITABLE)
+        imp = Importer (ar, buftools.PyBUF_WRITABLE)
         self.assertEqual (imp.ndim, 0)
         self.assertTrue (imp.format is None)
-        imp = BufferImporter (ar, buftools.PyBUF_F_CONTIGUOUS)
+        imp = Importer (ar, buftools.PyBUF_F_CONTIGUOUS)
         self.assertEqual (imp.ndim, 2)
         self.assertTrue (imp.format is None)
         self.assertEqual (imp.shape, shape)
         self.assertEqual (imp.strides, strides)
-        imp = BufferImporter (ar, buftools.PyBUF_ANY_CONTIGUOUS)
+        imp = Importer (ar, buftools.PyBUF_ANY_CONTIGUOUS)
         self.assertEqual (imp.ndim, 2)
         self.assertTrue (imp.format is None)
         self.assertEqual (imp.shape, shape)
         self.assertEqual (imp.strides, strides)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises (BufferError, BufferImporter, ar, buftools.PyBUF_ND)
+        self.assertRaises (BufferError, Importer, ar, buftools.PyBUF_ND)
 
         ar_sliced = ar[:,::2]
         format = self.bitsize_to_format[s.get_bitsize ()]
         w, h = shape
         strides = ar_sliced.strides
         length = w * h * itemsize
-        imp = BufferImporter (ar_sliced, buftools.PyBUF_STRIDED)
+        imp = Importer (ar_sliced, buftools.PyBUF_STRIDED)
         self.assertEqual (imp.len, length)
         self.assertEqual (imp.ndim, 2)
         self.assertEqual (imp.itemsize, itemsize)
         self.assertEqual (imp.shape, shape)
         self.assertEqual (imp.strides, strides)
         self.assertEqual (imp.buf, s._pixels_address)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_SIMPLE)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_ND)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_ANY_CONTIGUOUS)
 
         ar_sliced = ar[::2,:]
         w, h = shape
         strides = ar_sliced.strides
         length = w * h * itemsize
-        imp = BufferImporter (ar_sliced, buftools.PyBUF_STRIDED)
+        imp = Importer (ar_sliced, buftools.PyBUF_STRIDED)
         self.assertEqual (imp.len, length)
         self.assertEqual (imp.ndim, 2)
         self.assertEqual (imp.itemsize, itemsize)
         self.assertEqual (imp.shape, shape)
         self.assertEqual (imp.strides, strides)
         self.assertEqual (imp.buf, s._pixels_address)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_SIMPLE)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_ND)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises (BufferError, BufferImporter, ar_sliced,
+        self.assertRaises (BufferError, Importer, ar_sliced,
                            buftools.PyBUF_ANY_CONTIGUOUS)
 
         s2 = s.subsurface ((2, 3, 5, 7))
         w, h = shape
         strides = ar.strides
         length = w * h * itemsize
-        imp = BufferImporter (ar, buftools.PyBUF_STRIDES)
+        imp = Importer (ar, buftools.PyBUF_STRIDES)
         self.assertTrue (imp.obj, ar)
         self.assertEqual (imp.len, length)
         self.assertEqual (imp.ndim, 2)
         self.assertEqual (imp.strides, strides)
         self.assertTrue (imp.suboffsets is None)
         self.assertEqual (imp.buf, s2._pixels_address)
-        self.assertRaises (BufferError, BufferImporter, ar,
-                           buftools.PyBUF_SIMPLE)
-        self.assertRaises (BufferError, BufferImporter, ar,
-                           buftools.PyBUF_FORMAT)
-        self.assertRaises (BufferError, BufferImporter, ar,
-                           buftools.PyBUF_WRITABLE)
-        self.assertRaises (BufferError, BufferImporter, ar,
-                           buftools.PyBUF_ND)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar, buftools.PyBUF_SIMPLE)
+        self.assertRaises (BufferError, Importer, ar, buftools.PyBUF_FORMAT)
+        self.assertRaises (BufferError, Importer, ar, buftools.PyBUF_WRITABLE)
+        self.assertRaises (BufferError, Importer, ar, buftools.PyBUF_ND)
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_ANY_CONTIGUOUS)
 
     def NEWBUF_test_newbuf_1D (self):
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
 
         s = pygame.Surface ((2, 16), 0, 32)
         ar_2D = pygame.PixelArray (s)
         strides = ar.strides
         length = h * itemsize
         buf = s._pixels_address + x * itemsize
-        imp = BufferImporter (ar, buftools.PyBUF_STRIDES)
+        imp = Importer (ar, buftools.PyBUF_STRIDES)
         self.assertTrue (imp.obj, ar)
         self.assertEqual (imp.len, length)
         self.assertEqual (imp.ndim, 1)
         self.assertEqual (imp.strides, strides)
         self.assertTrue (imp.suboffsets is None)
         self.assertEqual (imp.buf, buf)
-        imp = BufferImporter (ar, buftools.PyBUF_FULL)
+        imp = Importer (ar, buftools.PyBUF_FULL)
         self.assertEqual (imp.ndim, 1)
         self.assertEqual (imp.format, format)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_SIMPLE)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_FORMAT)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_WRITABLE)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_ND)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises (BufferError, BufferImporter, ar,
+        self.assertRaises (BufferError, Importer, ar,
                            buftools.PyBUF_ANY_CONTIGUOUS)
         y = 10
         ar = ar_2D[:,y]
         strides = ar.strides
         length = w * itemsize
         buf = s._pixels_address + y * s.get_pitch()
-        imp = BufferImporter (ar, buftools.PyBUF_FULL)
+        imp = Importer (ar, buftools.PyBUF_FULL)
         self.assertEqual (imp.len, length)
         self.assertEqual (imp.ndim, 1)
         self.assertEqual (imp.itemsize, itemsize)
         self.assertEqual (imp.strides, strides)
         self.assertEqual (imp.buf, buf)
         self.assertTrue (imp.suboffsets is None)
-        imp = BufferImporter (ar, buftools.PyBUF_SIMPLE)
+        imp = Importer (ar, buftools.PyBUF_SIMPLE)
         self.assertEqual (imp.len, length)
         self.assertEqual (imp.ndim, 0)
         self.assertEqual (imp.itemsize, itemsize)
         self.assertFalse (imp.readonly)
         self.assertTrue (imp.shape is None)
         self.assertTrue (imp.strides is None)
-        imp = BufferImporter (ar, buftools.PyBUF_ND)
+        imp = Importer (ar, buftools.PyBUF_ND)
         self.assertEqual (imp.len, length)
         self.assertEqual (imp.ndim, 1)
         self.assertEqual (imp.itemsize, itemsize)
         self.assertFalse (imp.readonly)
         self.assertEqual (imp.shape, shape)
         self.assertTrue (imp.strides is None)
-        imp = BufferImporter (ar, buftools.PyBUF_C_CONTIGUOUS)
+        imp = Importer (ar, buftools.PyBUF_C_CONTIGUOUS)
         self.assertEqual (imp.ndim, 1)
-        imp = BufferImporter (ar, buftools.PyBUF_F_CONTIGUOUS)
+        imp = Importer (ar, buftools.PyBUF_F_CONTIGUOUS)
         self.assertEqual (imp.ndim, 1)
-        imp = BufferImporter (ar, buftools.PyBUF_ANY_CONTIGUOUS)
+        imp = Importer (ar, buftools.PyBUF_ANY_CONTIGUOUS)
         self.assertEqual (imp.ndim, 1)
 
 

test/surface_test.py

 
     def NEWBUF_test_newbuf_PyBUF_flags_bytes(self):
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
         s = pygame.Surface((10, 6), 0, 32)
         a = s.get_buffer('&')
-        b = BufferImporter(a, buftools.PyBUF_SIMPLE)
+        b = Importer(a, buftools.PyBUF_SIMPLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s._pixels_address)
-        b = BufferImporter(a, buftools.PyBUF_WRITABLE)
+        b = Importer(a, buftools.PyBUF_WRITABLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertFalse(b.readonly)
-        b = BufferImporter(a, buftools.PyBUF_FORMAT)
+        b = Importer(a, buftools.PyBUF_FORMAT)
         self.assertEqual(b.ndim, 0)
         self.assertEqual(b.format, 'B')
-        b = BufferImporter(a, buftools.PyBUF_ND)
+        b = Importer(a, buftools.PyBUF_ND)
         self.assertEqual(b.ndim, 1)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s._pixels_address)
-        b = BufferImporter(a, buftools.PyBUF_STRIDES)
+        b = Importer(a, buftools.PyBUF_STRIDES)
         self.assertEqual(b.ndim, 1)
         self.assertTrue(b.format is None)
         self.assertEqual(b.strides, (1,))
         s2 = s.subsurface((1, 1, 7, 4)) # Not contiguous
         a = s2.get_buffer('&')
-        b = BufferImporter(a, buftools.PyBUF_SIMPLE)
+        b = Importer(a, buftools.PyBUF_SIMPLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s2._pixels_address)
-        b = BufferImporter(a, buftools.PyBUF_C_CONTIGUOUS)
+        b = Importer(a, buftools.PyBUF_C_CONTIGUOUS)
         self.assertEqual(b.ndim, 1)
         self.assertEqual(b.strides, (1,))
-        b = BufferImporter(a, buftools.PyBUF_F_CONTIGUOUS)
+        b = Importer(a, buftools.PyBUF_F_CONTIGUOUS)
         self.assertEqual(b.ndim, 1)
         self.assertEqual(b.strides, (1,))
-        b = BufferImporter(a, buftools.PyBUF_ANY_CONTIGUOUS)
+        b = Importer(a, buftools.PyBUF_ANY_CONTIGUOUS)
         self.assertEqual(b.ndim, 1)
         self.assertEqual(b.strides, (1,))
 
         # This is the same handler as for the '&' buffer kind, so just
         # confirm that it succeeds for one case.
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
         s = pygame.Surface((10, 6), 0, 32)
         a = s.get_buffer('0')
-        b = BufferImporter(a, buftools.PyBUF_SIMPLE)
+        b = Importer(a, buftools.PyBUF_SIMPLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
 
     def NEWBUF_test_newbuf_PyBUF_flags_1D(self):
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
         s = pygame.Surface((10, 6), 0, 32)
         a = s.get_buffer('1')
-        b = BufferImporter(a, buftools.PyBUF_SIMPLE)
+        b = Importer(a, buftools.PyBUF_SIMPLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s._pixels_address)
-        b = BufferImporter(a, buftools.PyBUF_WRITABLE)
+        b = Importer(a, buftools.PyBUF_WRITABLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertFalse(b.readonly)
-        b = BufferImporter(a, buftools.PyBUF_FORMAT)
+        b = Importer(a, buftools.PyBUF_FORMAT)
         self.assertEqual(b.ndim, 0)
         self.assertEqual(b.format, '=I')
-        b = BufferImporter(a, buftools.PyBUF_ND)
+        b = Importer(a, buftools.PyBUF_ND)
         self.assertEqual(b.ndim, 1)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s._pixels_address)
-        b = BufferImporter(a, buftools.PyBUF_STRIDES)
+        b = Importer(a, buftools.PyBUF_STRIDES)
         self.assertEqual(b.ndim, 1)
         self.assertTrue(b.format is None)
         self.assertEqual(b.strides, (s.get_bytesize(),))
 
     def NEWBUF_test_newbuf_PyBUF_flags_2D(self):
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
         s = pygame.Surface((10, 6), 0, 32)
         a = s.get_buffer('2')
         # Non dimensional requests, no PyDEF_ND, are handled by the
         # 1D surface buffer code, so only need to confirm a success.
-        b = BufferImporter(a, buftools.PyBUF_SIMPLE)
+        b = Importer(a, buftools.PyBUF_SIMPLE)
         self.assertEqual(b.ndim, 0)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s._pixels_address)
         # Uniquely 2D
-        b = BufferImporter(a, buftools.PyBUF_STRIDES)
+        b = Importer(a, buftools.PyBUF_STRIDES)
         self.assertEqual(b.ndim, 2)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s._pixels_address)
-        b = BufferImporter(a, buftools.PyBUF_RECORDS_RO)
+        b = Importer(a, buftools.PyBUF_RECORDS_RO)
         self.assertEqual(b.ndim, 2)
         self.assertEqual(b.format, '=I')
         self.assertEqual(b.strides, (s.get_bytesize(), s.get_pitch()))
-        b = BufferImporter(a, buftools.PyBUF_RECORDS)
+        b = Importer(a, buftools.PyBUF_RECORDS)
         self.assertEqual(b.ndim, 2)
         self.assertEqual(b.format, '=I')
         self.assertEqual(b.strides, (s.get_bytesize(), s.get_pitch()))
-        b = BufferImporter(a, buftools.PyBUF_F_CONTIGUOUS)
+        b = Importer(a, buftools.PyBUF_F_CONTIGUOUS)
         self.assertEqual(b.ndim, 2)
         self.assertEqual(b.format, None)
         self.assertEqual(b.strides, (s.get_bytesize(), s.get_pitch()))
-        b = BufferImporter(a, buftools.PyBUF_ANY_CONTIGUOUS)
+        b = Importer(a, buftools.PyBUF_ANY_CONTIGUOUS)
         self.assertEqual(b.ndim, 2)
         self.assertEqual(b.format, None)
         self.assertEqual(b.strides, (s.get_bytesize(), s.get_pitch()))
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_ND)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_ND)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_C_CONTIGUOUS)
         s2 = s.subsurface((1, 1, 7, 4)) # Not contiguous
         a = s2.get_buffer('2')
-        b = BufferImporter(a, buftools.PyBUF_STRIDES)
+        b = Importer(a, buftools.PyBUF_STRIDES)
         self.assertEqual(b.ndim, 2)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.length)
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s2._pixels_address)
-        b = BufferImporter(a, buftools.PyBUF_RECORDS)
+        b = Importer(a, buftools.PyBUF_RECORDS)
         self.assertEqual(b.ndim, 2)
         self.assertEqual(b.format, '=I')
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_SIMPLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_FORMAT)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_SIMPLE)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_FORMAT)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_WRITABLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_ND)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_ND)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_ANY_CONTIGUOUS)
 
     def NEWBUF_test_newbuf_PyBUF_flags_3D(self):
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
         s = pygame.Surface((12, 6), 0, 24)
         rmask, gmask, bmask, amask = s.get_masks()
         if (self.lilendian):
                 color_step = -1
                 addr_offset = 2
         a = s.get_buffer('3')
-        b = BufferImporter(a, buftools.PyBUF_STRIDES)
+        b = Importer(a, buftools.PyBUF_STRIDES)
         w, h = s.get_size()
         shape = w, h, 3
         strides = 3, s.get_pitch(), color_step
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s._pixels_address + addr_offset)
-        b = BufferImporter(a, buftools.PyBUF_RECORDS_RO)
+        b = Importer(a, buftools.PyBUF_RECORDS_RO)
         self.assertEqual(b.ndim, 3)
         self.assertEqual(b.format, 'B')
         self.assertEqual(b.strides, strides)
-        b = BufferImporter(a, buftools.PyBUF_RECORDS)
+        b = Importer(a, buftools.PyBUF_RECORDS)
         self.assertEqual(b.ndim, 3)
         self.assertEqual(b.format, 'B')
         self.assertEqual(b.strides, strides)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_SIMPLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_FORMAT)
-        self.assertRaises(BufferError, BufferImporter, a,
-                          buftools.PyBUF_WRITABLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_ND)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_SIMPLE)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_FORMAT)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_WRITABLE)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_ND)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_ANY_CONTIGUOUS)
 
     def NEWBUF_test_newbuf_PyBUF_flags_rgba(self):
         # All color plane views are handled by the same routine,
         # so only one plane need be checked.
         buftools = self.buftools
-        BufferImporter = buftools.BufferImporter
+        Importer = buftools.Importer
         s = pygame.Surface((12, 6), 0, 24)
         rmask, gmask, bmask, amask = s.get_masks()
         if (self.lilendian):
             else:
                 addr_offset = 2
         a = s.get_buffer('R')
-        b = BufferImporter(a, buftools.PyBUF_STRIDES)
+        b = Importer(a, buftools.PyBUF_STRIDES)
         w, h = s.get_size()
         shape = w, h
         strides = s.get_bytesize(), s.get_pitch()
         self.assertTrue(b.suboffsets is None)
         self.assertFalse(b.readonly)
         self.assertEqual(b.buf, s._pixels_address + addr_offset)
-        b = BufferImporter(a, buftools.PyBUF_RECORDS_RO)
+        b = Importer(a, buftools.PyBUF_RECORDS_RO)
         self.assertEqual(b.ndim, 2)
         self.assertEqual(b.format, 'B')
         self.assertEqual(b.strides, strides)
-        b = BufferImporter(a, buftools.PyBUF_RECORDS)
+        b = Importer(a, buftools.PyBUF_RECORDS)
         self.assertEqual(b.ndim, 2)
         self.assertEqual(b.format, 'B')
         self.assertEqual(b.strides, strides)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_SIMPLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_FORMAT)
-        self.assertRaises(BufferError, BufferImporter, a,
-                          buftools.PyBUF_WRITABLE)
-        self.assertRaises(BufferError, BufferImporter, a, buftools.PyBUF_ND)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_SIMPLE)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_FORMAT)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_WRITABLE)
+        self.assertRaises(BufferError, Importer, a, buftools.PyBUF_ND)
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_C_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_F_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a,
+        self.assertRaises(BufferError, Importer, a,
                           buftools.PyBUF_ANY_CONTIGUOUS)
 
 class SurfaceBlendTest (unittest.TestCase):

test/test_utils/buftools.py

 """Module pygame.tests.test_utils.array
 
-Export the BufferExporter and BufferImporter classes.
+Export the Exporter and Importer classes.
 
-Class BufferExporter has configurable shape and strides. BufferExporter objects
+Class Exporter has configurable shape and strides. Exporter objects
 provide a convient target for unit tests on Pygame objects and functions that
 import a new buffer interface.
 
-Class BufferImporter imports a buffer interface with the given PyBUF_* flags.
+Class Importer imports a buffer interface with the given PyBUF_* flags.
 It returns NULL Py_buffer fields as None. The shape, strides, and suboffsets
 arrays are returned as tuples of ints. All Py_buffer field properties are
 read-only. This class is useful in comparing exported buffer interfaces
 except NameError:
     from functools import reduce
 
-__all__ = ["BufferExporter", "BufferImporter"]
+__all__ = ["Exporter", "Importer"]
 
 def _prop_get(fn):
     return property(fn)
 
-class BufferExporter(pygame.newbuffer.BufferMixin):
+class Exporter(pygame.newbuffer.BufferMixin):
     """An object that exports a multi-dimension new buffer interface
 
        The only array operation this type supports is to export a buffer.
         return False
 
 
-class BufferImporter(object):
+class Importer(object):
     """An object that imports a new buffer interface
 
        The fields of the Py_buffer C struct are exposed by identically
-       named BufferImporter read-only properties.
+       named Importer read-only properties.
     """
     def __init__(self, obj, flags):
         self._view = pygame.newbuffer.Py_buffer()
         return tuple(cast(addr, POINTER(c_ssize_t))[0:self._view.ndim])
 
 
-class BufferExporterTest(unittest.TestCase):
-    """Class BufferExporter unit tests"""
+class ExporterTest(unittest.TestCase):
+    """Class Exporter unit tests"""
     def test_formats(self):
         char_sz = ctypes.sizeof(ctypes.c_char)
         short_sz = ctypes.sizeof(ctypes.c_short)
         self.check_args(1, (1,), '7x', (7,), 7, 7, 7)
         self.check_args(1, (1,), '8x', (8,), 8, 8, 8)
         self.check_args(1, (1,), '9x', (9,), 9, 9, 9)
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), 'W')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '^Q')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '=W')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '=f')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '=d')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '<f')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '<d')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '>f')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '>d')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '!f')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '!d')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '0x')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '1h')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), '11x')
-        self.assertRaises(ValueError, BufferExporter, (2, 1), 'BB')
+        self.assertRaises(ValueError, Exporter, (2, 1), '')
+        self.assertRaises(ValueError, Exporter, (2, 1), 'W')
+        self.assertRaises(ValueError, Exporter, (2, 1), '^Q')
+        self.assertRaises(ValueError, Exporter, (2, 1), '=W')
+        self.assertRaises(ValueError, Exporter, (2, 1), '=f')
+        self.assertRaises(ValueError, Exporter, (2, 1), '=d')
+        self.assertRaises(ValueError, Exporter, (2, 1), '<f')
+        self.assertRaises(ValueError, Exporter, (2, 1), '<d')
+        self.assertRaises(ValueError, Exporter, (2, 1), '>f')
+        self.assertRaises(ValueError, Exporter, (2, 1), '>d')
+        self.assertRaises(ValueError, Exporter, (2, 1), '!f')
+        self.assertRaises(ValueError, Exporter, (2, 1), '!d')
+        self.assertRaises(ValueError, Exporter, (2, 1), '0x')
+        self.assertRaises(ValueError, Exporter, (2, 1), '1h')
+        self.assertRaises(ValueError, Exporter, (2, 1), '11x')
+        self.assertRaises(ValueError, Exporter, (2, 1), 'BB')
 
     def test_strides(self):
         self.check_args(1, (10,), '=h', (2,), 20, 20, 2)
         self.check_args(3, (7, 5), '3x', (3, 24), 105, 120, 3)
 
     def test_readonly(self):
-        a = BufferExporter((2,), 'h', readonly=True)
+        a = Exporter((2,), 'h', readonly=True)
         self.assertTrue(a.readonly)
-        b = BufferImporter(a, PyBUF_STRIDED_RO)
-        self.assertRaises(BufferError, BufferImporter, a, PyBUF_STRIDED)
-        b = BufferImporter(a, PyBUF_STRIDED_RO)
+        b = Importer(a, PyBUF_STRIDED_RO)
+        self.assertRaises(BufferError, Importer, a, PyBUF_STRIDED)
+        b = Importer(a, PyBUF_STRIDED_RO)
 
     def test_is_contiguous(self):
-        a = BufferExporter((10,), '=h')
+        a = Exporter((10,), '=h')
         self.assertTrue(a.is_contiguous('C'))
         self.assertTrue(a.is_contiguous('F'))
         self.assertTrue(a.is_contiguous('A'))
-        a = BufferExporter((10, 4), '=h')
+        a = Exporter((10, 4), '=h')
         self.assertTrue(a.is_contiguous('C'))
         self.assertTrue(a.is_contiguous('A'))
         self.assertFalse(a.is_contiguous('F'))
-        a = BufferExporter((13, 5, 11, 3), '=h', (330, 66, 6, 2))
+        a = Exporter((13, 5, 11, 3), '=h', (330, 66, 6, 2))
         self.assertTrue(a.is_contiguous('C'))
         self.assertTrue(a.is_contiguous('A'))
         self.assertFalse(a.is_contiguous('F'))
-        a = BufferExporter((10, 4), '=h', (2, 20))
+        a = Exporter((10, 4), '=h', (2, 20))
         self.assertTrue(a.is_contiguous('F'))
         self.assertTrue(a.is_contiguous('A'))
         self.assertFalse(a.is_contiguous('C'))
-        a = BufferExporter((13, 5, 11, 3), '=h', (2, 26, 130, 1430))
+        a = Exporter((13, 5, 11, 3), '=h', (2, 26, 130, 1430))
         self.assertTrue(a.is_contiguous('F'))
         self.assertTrue(a.is_contiguous('A'))
         self.assertFalse(a.is_contiguous('C'))
-        a = BufferExporter((2, 11, 6, 4), '=h', (576, 48, 8, 2))
+        a = Exporter((2, 11, 6, 4), '=h', (576, 48, 8, 2))
         self.assertFalse(a.is_contiguous('A'))
-        a = BufferExporter((2, 11, 6, 4), '=h', (2, 4, 48, 288))
+        a = Exporter((2, 11, 6, 4), '=h', (2, 4, 48, 288))
         self.assertFalse(a.is_contiguous('A'))
-        a = BufferExporter((3, 2, 2), '=h', (16, 8, 4))
+        a = Exporter((3, 2, 2), '=h', (16, 8, 4))
         self.assertFalse(a.is_contiguous('A'))
-        a = BufferExporter((3, 2, 2), '=h', (4, 12, 24))
+        a = Exporter((3, 2, 2), '=h', (4, 12, 24))
         self.assertFalse(a.is_contiguous('A'))
 
     def test_PyBUF_flags(self):
-        a = BufferExporter((10, 2), 'd')
-        b = BufferImporter(a, PyBUF_SIMPLE)
+        a = Exporter((10, 2), 'd')
+        b = Importer(a, PyBUF_SIMPLE)
         self.assertTrue(b.obj is a)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.len)
         self.assertTrue(b.suboffsets is None)
         self.assertTrue(b.internal is None)
         self.assertFalse(b.readonly)
-        b = BufferImporter(a, PyBUF_WRITABLE)
+        b = Importer(a, PyBUF_WRITABLE)
         self.assertTrue(b.obj is a)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.len)
         self.assertTrue(b.suboffsets is None)
         self.assertTrue(b.internal is None)
         self.assertFalse(b.readonly)
-        b = BufferImporter(a, PyBUF_ND)
+        b = Importer(a, PyBUF_ND)
         self.assertTrue(b.obj is a)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.len)
         self.assertTrue(b.suboffsets is None)
         self.assertTrue(b.internal is None)
         self.assertFalse(b.readonly)
-        a = BufferExporter((5, 10), '=h', (24, 2))
-        b = BufferImporter(a, PyBUF_STRIDES)
+        a = Exporter((5, 10), '=h', (24, 2))
+        b = Importer(a, PyBUF_STRIDES)
         self.assertTrue(b.obj is a)
         self.assertTrue(b.format is None)
         self.assertEqual(b.len, a.len)
         self.assertTrue(b.suboffsets is None)
         self.assertTrue(b.internal is None)
         self.assertFalse(b.readonly)
-        b = BufferImporter(a, PyBUF_FULL)
+        b = Importer(a, PyBUF_FULL)
         self.assertTrue(b.obj is a)
         self.assertEqual(b.format, '=h')
         self.assertEqual(b.len, a.len)
         self.assertTrue(b.suboffsets is None)
         self.assertTrue(b.internal is None)
         self.assertFalse(b.readonly)
-        self.assertRaises(BufferError, BufferImporter, a, PyBUF_SIMPLE)
-        self.assertRaises(BufferError, BufferImporter, a, PyBUF_WRITABLE)
-        self.assertRaises(BufferError, BufferImporter, a, PyBUF_ND)
-        self.assertRaises(BufferError, BufferImporter, a, PyBUF_C_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a, PyBUF_F_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a, PyBUF_ANY_CONTIGUOUS)
-        self.assertRaises(BufferError, BufferImporter, a, PyBUF_CONTIG)
+        self.assertRaises(BufferError, Importer, a, PyBUF_SIMPLE)
+        self.assertRaises(BufferError, Importer, a, PyBUF_WRITABLE)
+        self.assertRaises(BufferError, Importer, a, PyBUF_ND)
+        self.assertRaises(BufferError, Importer, a, PyBUF_C_CONTIGUOUS)
+        self.assertRaises(BufferError, Importer, a, PyBUF_F_CONTIGUOUS)
+        self.assertRaises(BufferError, Importer, a, PyBUF_ANY_CONTIGUOUS)
+        self.assertRaises(BufferError, Importer, a, PyBUF_CONTIG)
 
     def test_attributes(self):
-        a = BufferExporter((13, 5, 11, 3), '=h', (440, 88, 8, 2))
+        a = Exporter((13, 5, 11, 3), '=h', (440, 88, 8, 2))
         self.assertEqual(a.ndim, 4)
         self.assertEqual(a.itemsize, 2)
         self.assertFalse(a.readonly)
         self.assertEqual(a.len, 4290)
         self.assertEqual(a.buflen, 5720)
         self.assertEqual(a.buf, ctypes.addressof(a._buf))
-        a = BufferExporter((8,))
+        a = Exporter((8,))
         self.assertEqual(a.ndim, 1)
         self.assertEqual(a.itemsize, 1)
         self.assertFalse(a.readonly)
         self.assertEqual(a.strides, (1,))
         self.assertEqual(a.len, 8)
         self.assertEqual(a.buflen, 8)
-        a = BufferExporter([13, 5, 11, 3], '=h', [440, 88, 8, 2])
+        a = Exporter([13, 5, 11, 3], '=h', [440, 88, 8, 2])
         self.assertTrue(isinstance(a.shape, tuple))
         self.assertTrue(isinstance(a.strides, tuple))
         self.assertEqual(a.shape, (13, 5, 11, 3))
                    shape, format, strides, length, bufsize, itemsize):
         format_arg = format if call_flags & 1 else None
         strides_arg = strides if call_flags & 2 else None
-        a = BufferExporter(shape, format_arg, strides_arg)
+        a = Exporter(shape, format_arg, strides_arg)
         self.assertEqual(a.buflen, bufsize)
-        m = BufferImporter(a, PyBUF_RECORDS_RO)
+        m = Importer(a, PyBUF_RECORDS_RO)
         self.assertEqual(m.buf, a.buf)
         self.assertEqual(m.len, length)
         self.assertEqual(m.format, format)