Commits

Lenard Lindstrom committed ff47b77

Remove some trailing white space and tabs

  • Participants
  • Parent commits 962e528

Comments (0)

Files changed (16)

 
     if (compiled.major != linked->major || compiled.minor != linked->minor)
     {
-		PyErr_Format(PyExc_RuntimeError, "SDL compiled with version %d.%d.%d, linked to %d.%d.%d",
-                 compiled.major, compiled.minor, compiled.patch,
-                 linked->major, linked->minor, linked->patch);
+        PyErr_Format(PyExc_RuntimeError,
+                     "SDL compiled with version %d.%d.%d, linked to %d.%d.%d",
+                     compiled.major, compiled.minor, compiled.patch,
+                     linked->major, linked->minor, linked->patch);
         return 0;
     }
     return 1;
 get_sdl_version (PyObject* self)
 {
     const SDL_version *v;
-	
+
     v = SDL_Linked_Version ();
     return Py_BuildValue ("iii", v->major, v->minor, v->patch);
 }
     float f= (float)PyFloat_AsDouble (obj);
 
     if (f==-1 && PyErr_Occurred()) {
-		PyErr_Clear ();
+        PyErr_Clear ();
         return 0;
-	}
-    
+    }
+
     *val = f;
     return 1;
 }
         module = PyImport_ImportModule ("pygame.macosx");
         if (!module)
         {
-        	printf("ERROR: pygame.macosx import FAILED\n");
+            printf("ERROR: pygame.macosx import FAILED\n");
             return -1;
         }
 
         Py_DECREF (module);
         if (!rval)
         {
-        	printf("ERROR: pygame.macosx.Video_AutoInit() call FAILED\n");
+            printf("ERROR: pygame.macosx.Video_AutoInit() call FAILED\n");
             return -1;
         }
 
                         PyArrayInterface* inter_p, int flags)
 {
     ViewInternals* internal_p;
-    ssize_t sz = (sizeof (ViewInternals) + 
+    ssize_t sz = (sizeof (ViewInternals) +
                   (2 * inter_p->nd - 1) * sizeof (Py_ssize_t));
     int readonly = inter_p->flags & PAI_WRITEABLE ? 0 : 1;
     Py_ssize_t i;
 
         case 1:
             *fchar_p = 'b';
-            break; 
+            break;
         case 2:
             *fchar_p = 'h';
             break;
 
         case 1:
             *fchar_p = 'B';
-            break; 
+            break;
         case 2:
             *fchar_p = 'H';
             break;
 {
 #ifdef HAVE_SIGNAL_H
     char* signaltype;
-    
+
     signal (sig, SIG_DFL);
     switch (sig)
     {
 
     _quit ();
     Py_FatalError (signaltype);
-#endif    
+#endif
 }
 
 
         if (ohandler != SIG_DFL)
             signal (fatal_signals[i], ohandler);
     }
-    
-#if defined(SIGALRM) && defined(HAVE_SIGACTION) 
+
+#if defined(SIGALRM) && defined(HAVE_SIGACTION)
     {/* Set SIGALRM to be ignored -- necessary on Solaris */
         struct sigaction action, oaction;
         /* Set SIG_IGN action */
             sigaction (SIGALRM, &oaction, NULL);
     }
 #endif
-#endif    
+#endif
     return;
 }
 
         if (ohandler != pygame_parachute)
             signal (fatal_signals[i], ohandler);
     }
-#endif    
+#endif
 }
 
 /* bind functions to python */
         }
         Py_DECREF (rval);
         Py_AtExit (atexit_quit);
-#ifdef HAVE_SIGNAL_H    
+#ifdef HAVE_SIGNAL_H
         install_parachute ();
 #endif
 

File src/bufferproxy.c

         _proxy_release_view(self);
         return 0;
     }
-    return py_raw;        
+    return py_raw;
 }
 
 static PyObject *
 static Py_ssize_t _color_length (PyColor *color);
 static PyObject* _color_item (PyColor *color, Py_ssize_t _index);
 static int _color_ass_item (PyColor *color, Py_ssize_t _index, PyObject *value);
-static PyObject * _color_slice(register PyColor *a, 
-                               register Py_ssize_t ilow, 
+static PyObject * _color_slice(register PyColor *a,
+                               register Py_ssize_t ilow,
                                register Py_ssize_t ihigh);
 
 /* Mapping protocol methods. */
     0,                          /* tp_subclasses */
     0,                          /* tp_weaklist */
     0                           /* tp_del */
-#endif    
+#endif
 };
 
 #define PyColor_Check(o) \
         *color = (Uint32) longval;
         return 1;
     }
-    
+
     /* Failed */
     PyErr_SetString (PyExc_ValueError, "invalid color argument");
     return 0;
 {
     if (PyType_IsSubtype (obj->ob_type, &PyColor_Type))
     {
-	rgba[0] = ((PyColor *) obj)->data[0];
-	rgba[1] = ((PyColor *) obj)->data[1];
-	rgba[2] = ((PyColor *) obj)->data[2];
-	rgba[3] = ((PyColor *) obj)->data[3];
-	return 1;
+        rgba[0] = ((PyColor *) obj)->data[0];
+        rgba[1] = ((PyColor *) obj)->data[1];
+        rgba[2] = ((PyColor *) obj)->data[2];
+        rgba[3] = ((PyColor *) obj)->data[3];
+        return 1;
     }
     else if (PyType_IsSubtype (obj->ob_type, &PyTuple_Type))
     {
 
     if (!PyArg_ParseTuple (args, "O|OOO", &obj, &obj1, &obj2, &obj3))
         return NULL;
-    
+
     if (Text_Check (obj) || PyUnicode_Check (obj))
     {
         /* Named color */
         PyObject *name1 = NULL, *name2 = NULL;
         if (obj1 || obj2 || obj3)
             return RAISE (PyExc_ValueError, "invalid arguments");
-        
+
         name1 = PyObject_CallMethod(obj, "replace", "(ss)", " ", "");
         if (!name1)
         {
     else
     {
         Uint32 color = 0;
-        
+
         /* Color (R,G,B[,A]) */
         if (!_get_color (obj, &color) || color > 255)
             return RAISE (PyExc_ValueError, "invalid color argument");
     double frgba[4];
     Uint8 rgba[4];
     double _gamma;
-    
+
     if (!PyArg_ParseTuple (args, "d", &_gamma))
         return NULL;
 
     }
     /* Calculate S */
     hsv[1] = 100. * (maxv - minv) / maxv;
-    
+
     /* Calculate H */
     if (maxv == frgb[0])
         hsv[0] = fmod ((60 * ((frgb[1] - frgb[2]) / diff)), 360.f);
     else
         hsl[1] = diff / (2 - maxv - minv);
     hsl[1] *= 100.f;
-    
+
     /* Calculate H */
     if (maxv == frgb[0])
         hsl[0] = fmod ((60 * ((frgb[1] - frgb[2]) / diff)), 360.f);
     frgb[0] = color->data[0] / 255.0;
     frgb[1] = color->data[1] / 255.0;
     frgb[2] = color->data[2] / 255.0;
-    
+
     i1i2i3[0] = (frgb[0] + frgb[1] + frgb[2]) / 3.0f;
     i1i2i3[1] = (frgb[0] - frgb[2]) / 2.0f;
     i1i2i3[2] = (2 * frgb[1] - frgb[0] - frgb[2]) / 4.0f;
- 
+
     return Py_BuildValue ("(fff)", i1i2i3[0], i1i2i3[1], i1i2i3[2]);
 }
 
     frgb[0] = color->data[0] / 255.0;
     frgb[1] = color->data[1] / 255.0;
     frgb[2] = color->data[2] / 255.0;
-    
+
     cmy[0] = 1.0 - frgb[0];
     cmy[1] = 1.0 - frgb[1];
     cmy[2] = 1.0 - frgb[2];
-    
+
     return Py_BuildValue ("(fff)", cmy[0], cmy[1], cmy[2]);
 }
 
         return -1;
     }
     Py_DECREF (item);
-    
+
     color->data[0] = (Uint8) ((1.0 - cmy[0]) * 255);
     color->data[1] = (Uint8) ((1.0 - cmy[1]) * 255);
     color->data[2] = (Uint8) ((1.0 - cmy[2]) * 255);
 static PyObject*
 _color_int (PyColor *color)
 {
-    Uint32 tmp = (color->data[0] << 24) + (color->data[1] << 16) + 
+    Uint32 tmp = (color->data[0] << 24) + (color->data[1] << 16) +
                  (color->data[2] << 8) + color->data[3];
 #if !PY3
     if (tmp < LONG_MAX)
 
 
 static PyObject *
-_color_slice(register PyColor *a, 
-             register Py_ssize_t ilow, 
+_color_slice(register PyColor *a,
+             register Py_ssize_t ilow,
              register Py_ssize_t ihigh)
 {
 
 
         len = ihigh - ilow;
         /* printf("2 ilow :%d:, ihigh:%d: len:%d:\n", ilow, ihigh, len); */
-        
+
         if(ilow == 0) {
             c1 = a->data[0];
             c2 = a->data[1];
     switch (_coerce_obj (o1, rgba1.bytes))
     {
     case -1:
-	return 0;
+        return 0;
     case 0:
-	goto Unimplemented;
+        goto Unimplemented;
     default:
         break;
     }
     switch (_coerce_obj (o2, rgba2.bytes))
     {
     case -1:
-	return 0;
+        return 0;
     case 0:
-	goto Unimplemented;
+        goto Unimplemented;
     default:
         break;
     }
     PyObject *module;
     PyObject *apiobj;
     static void* c_api[PYGAMEAPI_COLOR_NUMSLOTS];
-    
+
 #if PY3
     static struct PyModuleDef _module = {
         PyModuleDef_HEAD_INIT,
     {
         MODINIT_ERROR;
     }
-    
+
     /* type preparation */
     if (PyType_Ready (&PyColor_Type) < 0)
     {
         Py_DECREF (_COLORDICT);
         MODINIT_ERROR;
     }
-    
+
     /* create the module */
 #if PY3
     module = PyModule_Create (&_module);
 snd_get_raw (PyObject* self)
 {
     Mix_Chunk* chunk = PySound_AsChunk (self);
-    
+
     MIXER_INIT_CHECK ();
 
     return Bytes_FromStringAndSize ((const char *)chunk->abuf,
 #endif
 
 #ifdef Py_DEBUG
-    result = 
+    result =
 #endif
     Mix_Volume (channelnum, (int)(volume*128));
     Py_RETURN_NONE;

File src/newbuffer.c

  * must be set. Also, the BUFOBJ_MEMFREE must not be set.
  *
  * The view_p->obj field should always be valid. It either points to
- * an object or is NULL. 
+ * an object or is NULL.
  */
 #define BUFOBJ_FILLED 0x0001
 #define BUFOBJ_MEMFREE 0x0002

File src/pgcompat.h

 
 #define MODINIT_ERROR MODINIT_RETURN (NULL)
 
-/* Module state. These macros are used to define per-module macros. 
+/* Module state. These macros are used to define per-module macros.
  * v - global state variable (Python 2.x)
  * s - global state structure (Python 3.x)
  */

File src/pixelarray.c

 }
 
 #include "pixelarray_methods.c"
-    
+
 /**
  * Methods, which are bound to the PyPixelArray type.
  */
 static PyGetSetDef _pxarray_getsets[] =
 {
     { "__dict__", (getter)_pxarray_get_dict, 0, 0, 0 },
-    { "surface", (getter)_pxarray_get_surface, 0, DOC_PIXELARRAYSURFACE, 0 }, 
+    { "surface", (getter)_pxarray_get_surface, 0, DOC_PIXELARRAYSURFACE, 0 },
     { "itemsize", (getter)_pxarray_get_itemsize, 0, DOC_PIXELARRAYITEMSIZE, 0 },
     { "shape", (getter)_pxarray_get_shape, 0, DOC_PIXELARRAYSHAPE, 0 },
     { "strides", (getter)_pxarray_get_strides, 0, DOC_PIXELARRAYSTRIDES, 0 },
     0,                          /* tp_subclasses */
     0,                          /* tp_weaklist */
     0                           /* tp_del */
-#endif    
+#endif
 };
 
 static PyPixelArray *
 _pxarray_get_dict(PyPixelArray *self, void *closure)
 {
     if (!self->dict) {
-	self->dict = PyDict_New();
+        self->dict = PyDict_New();
         if (!self->dict) {
             return 0;
         }
 static int
 _pxarray_getbuffer(PyPixelArray *self, Py_buffer *view_p, int flags)
 {
-    Py_ssize_t itemsize = 
+    Py_ssize_t itemsize =
         PySurface_AsSurface(self->surface)->format->BytesPerPixel;
     int ndim = self->shape[1] ? 2 : 1;
     Py_ssize_t *shape = 0;
 static PyObject *
 _pxarray_subscript_internal(PyPixelArray *array,
                             Py_ssize_t xstart,
-			    Py_ssize_t xstop,
-			    Py_ssize_t xstep,
-			    Py_ssize_t ystart,
-			    Py_ssize_t ystop,
-			    Py_ssize_t ystep)
+                            Py_ssize_t xstop,
+                            Py_ssize_t xstep,
+                            Py_ssize_t ystart,
+                            Py_ssize_t ystop,
+                            Py_ssize_t ystep)
 {
     /* Special case: if xstep or ystep are zero, then the corresponding
      * dimension is removed. If both are zero, then a single integer
         stride1 = 0;
     }
     pixels = (array->pixels +
-              xstart * array->strides[0] + 
+              xstart * array->strides[0] +
               ystart * array->strides[1]);
     return (PyObject *)_pxarray_new_internal(&PyPixelArray_Type, 0,
-					     array, pixels,
-					     dim0, dim1, stride0, stride1);
+                                             array, pixels,
+                                             dim0, dim1, stride0, stride1);
 }
 
 /**
 static int
 _array_assign_sequence(PyPixelArray *array, Py_ssize_t low, Py_ssize_t high,
                        PyObject *val)
-{ 
+{
     SDL_Surface *surf = PySurface_AsSurface(array->surface);
     SDL_PixelFormat *format;
     Py_ssize_t dim0 = ABS (high - low);
     if (!dim1) {
         dim1 = 1;
     }
-    
+
     Py_BEGIN_ALLOW_THREADS;
     /* Single value assignment. */
     switch (bpp) {
     else if (low > (Sint32)array->shape[0]) {
         low = array->shape[0];
     }
-    
+
     if (high < low) {
         high = low;
     }
         if (*start >= length || *start < 0) {
             PyErr_SetString(PyExc_IndexError, "invalid index");
             return -1;
-        }   
+        }
         *stop = (*start) + 1;
         *step = 0;
     }
         if (*start >= length || *start < 0) {
             PyErr_SetString(PyExc_IndexError, "invalid index");
             return -1;
-        }   
+        }
         *stop = (*start) + 1;
         *step = 0;
     }
         Py_ssize_t size = PySequence_Size(op);
         Py_ssize_t xstart, xstop, xstep;
         Py_ssize_t ystart, ystop, ystep;
-    
+
         if (size == 0) {
             /* array[,], array[()] ... */
             Py_INCREF(array);
         }
 
         return _pxarray_subscript_internal(array,
-					   xstart, xstop, xstep,
-					   ystart, ystop, ystep);
+                                           xstart, xstop, xstep,
+                                           ystart, ystop, ystep);
     }
     else if (op == Py_Ellipsis) {
         Py_INCREF(array);
             Py_RETURN_NONE;
         }
         return _pxarray_subscript_internal(array,
-					   start, stop, step, 0, dim1, 1);
+                                           start, stop, step, 0, dim1, 1);
     }
     else if (PyIndex_Check(op) || PyInt_Check(op) || PyLong_Check(op)) {
         Py_ssize_t i;
         if (i == -1 && PyErr_Occurred()) {
             return 0;
         }
-	if (i < 0) {
+        if (i < 0) {
             i += dim0;
-        }  
+        }
         if (i < 0 || i >= dim0) {
             return RAISE(PyExc_IndexError, "array index out of range");
         }
      */
     Py_ssize_t dim0 = array->shape[0];
     Py_ssize_t dim1 = array->shape[1];
-    
+
     /* Note: order matters here.
      * First check array[x,y], then array[x:y:z], then array[x]
      * Otherwise it'll fail.
         i = PyNumber_AsSsize_t(val, PyExc_IndexError);
 #else
         i = PyInt_Check(op) ? PyInt_AsLong (op) : PyLong_AsLong (op);
-#endif 
+#endif
         if (i == -1 && PyErr_Occurred()) {
             return -1;
         }
     if (PyType_Ready(&PyPixelArray_Type)) {
         MODINIT_ERROR;
     }
-    
+
     /* create the module */
 #if PY3
     module = PyModule_Create(&_module);

File src/pixelcopy.c

 /*
   pygame - Python Game Library
   Copyright (C) 2000-2001  Pete Shinners
-  
+
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
     int loopx, loopy;
     int stridex, stridey, stridez=0, stridez2=0, sizex, sizey;
     int Rloss, Gloss, Bloss, Rshift, Gshift, Bshift;
-    
+
     if (!PyArg_ParseTuple(arg, "O!O", &PySurface_Type, &surfobj, &arrayobj)) {
         return NULL;
     }
     surf = PySurface_AsSurface(surfobj);
     format = surf->format;
-    
+
     if (PgObject_GetBuffer(arrayobj, &pg_view, PyBUF_RECORDS_RO)) {
         return 0;
     }
         PgBuffer_Release(&pg_view);
         return NULL;
     }
-    
+
     array_data = (char *)view_p->buf;
 
     switch (surf->format->BytesPerPixel) {
         }
         return RAISE(PyExc_RuntimeError, "unsupported bit depth for image");
     }
-    
+
     PgBuffer_Release(&pg_view);
     if (!PySurface_UnlockBy(surfobj, arrayobj)) {
         return NULL;
         return 0;
     }
     surf = PySurface_AsSurface(surfobj);
-    
+
     if (PgObject_GetBuffer(arrayobj, &pg_view, PyBUF_RECORDS)) {
         PySurface_Unlock(surfobj);
         return 0;
     if (PgObject_GetBuffer(arg, &pg_view, PyBUF_RECORDS_RO)) {
         return 0;
     }
-    
+
     if (!(view_p->ndim == 2 || (view_p->ndim == 3 && view_p->shape[2] == 3))) {
         PgBuffer_Release(&pg_view);
         return RAISE (PyExc_ValueError, "must be a valid 2d or 3d array\n");
         PgBuffer_Release(&pg_view);
         return NULL;
     }
-    
+
     if (view_p->ndim == 2) {
         bitsperpixel = 8;
         rmask = 0xFF >> 6 << 5;
         SDL_FreeSurface(surf);
         return 0;
     }
-    
+
     args = Py_BuildValue("(OO)", surfobj, arg);
     if (!args) {
         PgBuffer_Release(&pg_view);
         Py_DECREF(surfobj);
         return 0;
     }
-    
+
     result = array_to_surface(self, args);
     PgBuffer_Release(&pg_view);
     Py_DECREF(args);

File src/pygame.h

 #define PG_CAPSULE_NAME(m) (IMPPREFIX m "." PYGAMEAPI_LOCAL_ENTRY)
 
 #define _IMPORT_PYGAME_MODULE(module, MODULE, api_root) {                   \
-	    PyObject *_module = PyImport_ImportModule (IMPPREFIX #module);      \
+        PyObject *_module = PyImport_ImportModule (IMPPREFIX #module);      \
                                                                             \
-	    if (_module != NULL) {                                              \
-	        PyObject *_c_api =                                              \
-	            PyObject_GetAttrString (_module, PYGAMEAPI_LOCAL_ENTRY);    \
+        if (_module != NULL) {                                              \
+            PyObject *_c_api =                                              \
+                PyObject_GetAttrString (_module, PYGAMEAPI_LOCAL_ENTRY);    \
                                                                             \
             Py_DECREF (_module);                                            \
             if (_c_api != NULL && PyCapsule_CheckExact (_c_api)) {          \
 #ifndef intrptr_t
 #define intptr_t int
 
-// No PySlice_GetIndicesEx on Py 2.2        
+// No PySlice_GetIndicesEx on Py 2.2
 #define PySlice_GetIndicesEx(a,b,c,d,e,f) PySlice_GetIndices(a,b,c,d,e)
 
-#define PyBool_FromLong(x) 	Py_BuildValue("b", x)
+#define PyBool_FromLong(x) Py_BuildValue("b", x)
 #endif
 
 // _symport_free and malloc are not exported in python.dll

File test/base_test.py

           # pygame.get_sdl_version(): return major, minor, patch
           # get the version number of SDL
 
-        self.assert_( len(pygame.get_sdl_version()) == 3) 
+        self.assert_( len(pygame.get_sdl_version()) == 3)
 
     class ExporterBase(object):
         def __init__(self, shape, typechar, itemsize):
             o = Exporter(shape, 'f', itemsize)
             v = BufferProxy(o)
             self.assertSame(v, o)
-        
+
     def test_GetView_array_struct(self):
         from pygame.bufferproxy import BufferProxy
 
         except NotImplementedError:
             # Scrap is optional.
             pass
-        
+
         # pygame.cdrom
         # pygame.joystick
 
 
           # pygame.quit(): return None
           # uninitialize all pygame modules
-        
+
         # Make sure everything is not init
         self.not_init_assertions()
-    
+
         # Initiate it
         pygame.init()
-        
+
         # Check
         self.init_assertions()
 
         # Quit
         pygame.quit()
-        
+
         # All modules have quit
         self.not_init_assertions()
 
 
           # register_quit(callable): return None
           # register a function to be called when pygame quits
-        
+
         self.assert_(not quit_hook_ran)
 
         pygame.init()
 
           # pygame.get_error(): return errorstr
           # get the current error message
-          # 
+          #
           # SDL maintains an internal error message. This message will usually
           # be given to you when pygame.error is raised. You will rarely need to
           # call this function.
-          # 
+          #
 
         self.assertEqual(pygame.get_error(), "")
         pygame.set_error("hi")
 
         # pygame.init(): return (numpass, numfail)
         # initialize all imported pygame modules
-        # 
+        #
         # Initialize all imported Pygame modules. No exceptions will be raised
         # if a module fails, but the total number if successful and failed
         # inits will be returned as a tuple. You can always initialize
         # individual modules manually, but pygame.init is a convenient way to
         # get everything started. The init() functions for individual modules
         # will raise exceptions when they fail.
-        # 
+        #
         # You may want to initalise the different modules seperately to speed
         # up your program or to not use things your game does not.
-        # 
+        #
         # It is safe to call this init() more than once: repeated calls will
         # have no effect. This is true even if you have pygame.quit() all the
         # modules.
-        # 
+        #
 
 
 
         # Make sure everything is not init
         self.not_init_assertions()
-    
+
         # Initiate it
         pygame.init()
-        
+
         # Check
         self.init_assertions()
 
         # Quit
         pygame.quit()
-        
+
         # All modules have quit
         self.not_init_assertions()
 
 
           # crash
 
-        self.fail() 
+        self.fail()
 
 if __name__ == '__main__':
     unittest.main()

File test/bufferproxy_test.py

         seglen, segaddr = get_write_buffer(bf, 0)
         self.assertEqual(segaddr, memaddr)
         self.assertEqual(seglen, len(content))
-        
+
         bf = BufferProxy({'shape': (len(content),),
                           'typestr': '|u1',
                           'data': (memaddr, True),

File test/color_test.py

 
         self.failIf(Color(255, 0, 0, 0) == [255, 0, 0, 0])
         self.failUnless(Color(255, 0, 0, 0) != [255, 0, 0, 0])
-        
+
         self.failIf([255, 0, 0, 0] == Color(255, 0, 0 ,0))
         self.failUnless([255, 0, 0, 0] != Color(255, 0, 0, 0))
 
         # slicing a color gives you back a tuple.
         # do all sorts of slice combinations.
         c = pygame.Color(1,2,3,4)
-        
+
         self.assertEquals((1,2,3,4), c[:])
         self.assertEquals((1,2,3), c[:-1])
-        
+
         self.assertEquals((), c[:-5])
-        
+
         self.assertEquals((1,2,3,4), c[:4])
         self.assertEquals((1,2,3,4), c[:5])
         self.assertEquals((1,2), c[:2])
         self.assertEquals((1,), c[:1])
         self.assertEquals((), c[:0])
-        
-        
+
+
         self.assertEquals((2,), c[1:-2])
         self.assertEquals((3, 4), c[-2:])
         self.assertEquals((4,), c[-1:])
-        
-        
+
+
         # NOTE: assigning to a slice is currently unsupported.
-        
-        
+
+
     def test_unpack(self):
         # should be able to unpack to r,g,b,a and r,g,b
         c = pygame.Color(1,2,3,4)
         r,g,b,a = c
         self.assertEquals((1,2,3,4), (r,g,b,a))
         self.assertEquals(c, (r,g,b,a))
-        
+
         c.set_length(3)
         r,g,b = c
         self.assertEquals((1,2,3), (r,g,b))
 
 
 
-        
+
 
 
     def test_length(self):
         self.assertRaises (ValueError, c.set_length, -1)
         self.assertRaises (ValueError, c.set_length, 0)
         self.assertRaises (ValueError, c.set_length, pow(2,long_(33)))
-        
-        
+
+
     def test_case_insensitivity_of_string_args(self):
         self.assertEquals(pygame.color.Color('red'), pygame.color.Color('Red'))
-    
+
     def test_color (self):
         c = pygame.Color (10, 20, 30, 40)
         self.assertEquals (c.r, 10)
         self.assertEquals (c.a, 255)
         self.assertRaises (ValueError, _assigna, c, -10)
         self.assertEquals (c.a, 255)
-        
+
     def test_repr (self):
         c = pygame.Color (68, 38, 26, 69)
         t = "(68, 38, 26, 69)"
         self.assertEquals (c[1], 48)
         self.assertRaises (ValueError, _assign_item, c, 2, "Hello")
         self.assertEquals (c[2], 173)
-        
+
     def test_Color_type_works_for_Surface_get_and_set_colorkey(self):
         s = pygame.Surface((32, 32))
-        
+
         c = pygame.Color(33, 22, 11, 255)
         s.set_colorkey(c)
 
             self.assert_(0 <= m <= 1)
             self.assert_(0 <= y <= 1)
 
-    def test_i1i2i3__all_elements_within_limits (self):        
+    def test_i1i2i3__all_elements_within_limits (self):
         for c in rgba_combos_Color_generator():
             i1, i2, i3 = c.i1i2i3
             self.assert_(  0   <= i1 <= 1)
         x = 0
         for c in rgba_combos_Color_generator():
             x += 1
-            
+
             other = pygame.Color(0)
-            
+
             try:
                 setattr(other, prop, getattr(c, prop))
                 #eg other.hsla = c.hsla
             try:
                 setattr(other, prop, getattr(c, prop))
                 #eg other.hsla = c.hsla
-                
+
                 self.assert_(abs(other.r - c.r) <= 1)
                 self.assert_(abs(other.b - c.b) <= 1)
                 self.assert_(abs(other.g - c.g) <= 1)
                 # CMY and I1I2I3 do not care about the alpha
                 if not prop in ("cmy", "i1i2i3"):
                     self.assert_(abs(other.a - c.a) <= 1)
-                
+
             except ValueError:
                 pass        # other tests will notify, this tests equation
 
     def test_hsla__sanity_testing_converted_should_equate_bar_rounding(self):
         self.colorspaces_converted_should_equate_bar_rounding('hsla')
-        
+
     def test_hsva__sanity_testing_converted_should_equate_bar_rounding(self):
         self.colorspaces_converted_should_equate_bar_rounding('hsva')
 
     def test_cmy__sanity_testing_converted_should_equate_bar_rounding(self):
         self.colorspaces_converted_should_equate_bar_rounding('cmy')
-                    
+
     def test_i1i2i3__sanity_testing_converted_should_equate_bar_rounding(self):
         self.colorspaces_converted_should_equate_bar_rounding('i1i2i3')
 
         for i, c in enumerate(rgba_combos_Color_generator()):
             gamma = gammas[i % gammas_len]
 
-            corrected = pygame.Color(*[gamma_correct(x, gamma) 
+            corrected = pygame.Color(*[gamma_correct(x, gamma)
                                                  for x in tuple(c)])
             lib_corrected = c.correct_gamma(gamma)
 
         #c2 = pygame.Color(255,254,253,252)
         pickle_string = pickle.dumps(c1)
         c1_frompickle = pickle.loads(pickle_string)
-        self.assertEqual(c1,c1_frompickle) 
+        self.assertEqual(c1,c1_frompickle)
 
 ################################################################################
 # only available if ctypes module is also available

File test/mixer_test.py

 
 ################################### CONSTANTS ##################################
 
-FREQUENCIES = [11025, 22050, 44100, 48000] 
+FREQUENCIES = [11025, 22050, 44100, 48000]
 SIZES       = [-16, -8, 8, 16]
 CHANNELS    = [1, 2]
 BUFFERS     = [3024]
             mixer.init(**kw_conf)
 
             mixer_conf = mixer.get_init()
-            
+
             self.assertEquals(
                 # Not all "sizes" are supported on all systems.
                 (mixer_conf[0], abs(mixer_conf[1]), mixer_conf[2]),
                  abs(kw_conf['size']),
                  kw_conf['channels'])
             )
-            
+
             mixer.quit()
-    
+
     def todo_test_pre_init__keyword_args(self):
         # Fails on Mac; probably older SDL_mixer
 ## Probably don't need to be so exhaustive. Besides being slow the repeated
             mixer.init()
 
             mixer_conf = mixer.get_init()
-            
+
             self.assertEquals(
                 # Not all "sizes" are supported on all systems.
                 (mixer_conf[0], abs(mixer_conf[1]), mixer_conf[2]),
                  abs(kw_conf['size']),
                  kw_conf['channels'])
             )
-            
+
             mixer.quit()
 
     def todo_test_pre_init__zero_values(self):
             mixer.pre_init(0, 0, 0, 0)
 
     def test_get_init__returns_exact_values_used_for_init(self):
-        return 
+        return
         # fix in 1.9 - I think it's a SDL_mixer bug.
 
         # TODO: When this bug is fixed, testing through every combination
                     configs.append ((f,s,c))
 
         print (configs)
-    
+
 
         for init_conf in configs:
             print (init_conf)
 
     def test_get_init__returns_None_if_mixer_not_initialized(self):
         self.assert_(mixer.get_init() is None)
-    
+
     def test_get_num_channels__defaults_eight_after_init(self):
         mixer.init()
-        
+
         num_channels = mixer.get_num_channels()
 
         self.assert_(num_channels == 8)
     def test_sound_args(self):
         def get_bytes(snd):
             return snd.get_raw()
-        
+
         mixer.init()
         try:
             sample = as_bytes('\x00\xff') * 24
             except TypeError:
                 self.assertEqual(str(geterror()), arg_emsg)
             else:
-                self.fail("no exception")           
+                self.fail("no exception")
             try:
                 mixer.Sound(buffer=sample, file=wave_path)
             except TypeError:
                 self.assertEqual(str(geterror()), arg_emsg)
             else:
-                self.fail("no exception")           
+                self.fail("no exception")
             try:
                 mixer.Sound(foobar=sample)
             except TypeError:
                 self.fail("no exception")
             snd = mixer.Sound(wave_path, **{})
             self.assertEqual(get_bytes(snd), snd_bytes)
-            snd = mixer.Sound(*[], **{'file': wave_path})          
+            snd = mixer.Sound(*[], **{'file': wave_path})
             try:
                snd = mixer.Sound([])
             except TypeError:
                 emsg = 'Unrecognized argument (type list)'
                 self.assertEqual(str(geterror()), emsg)
-            else:   
+            else:
                 self.fail("no exception")
             try:
                 snd = mixer.Sound(buffer=[])
             self.assertEqual(get_bytes(mixer.Sound(sample)), sample)
             self.assertEqual(get_bytes(mixer.Sound(file=bwave_path)), snd_bytes)
             self.assertEqual(get_bytes(mixer.Sound(bwave_path)), snd_bytes)
-            
+
             snd = mixer.Sound(wave_path)
             try:
                 mixer.Sound(wave_path, array=snd)
                 self.fail("no exception")
             snd2 = mixer.Sound(array=snd)
             self.assertEqual(snd.get_raw(), snd2.get_raw())
-            
+
         finally:
             mixer.quit()
 
             a3 <<= lshift
         self.assert_(all_(a2 == a3),
                      "Format %i, dtype %s" % (format, a.dtype))
-    
+
     def _test_array_interface_fail(self, a):
         self.assertRaises(ValueError, mixer.Sound, array=a)
- 
+
     def test_array_interface(self):
         mixer.init(22050, -16, 1)
         try:
 
           # pygame.mixer.fadeout(time): return None
           # fade out the volume on all sounds before stopping
-          # 
+          #
           # This will fade out the volume on all active channels over the time
           # argument in milliseconds. After the sound is muted the playback will
           # stop.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_find_channel(self):
 
 
           # pygame.mixer.find_channel(force=False): return Channel
           # find an unused channel
-          # 
+          #
           # This will find and return an inactive Channel object. If there are
           # no inactive Channels this function will return None. If there are no
           # inactive channels and the force argument is True, this will find the
           # Channel with the longest running Sound and return it.
-          # 
+          #
           # If the mixer has reserved channels from pygame.mixer.set_reserved()
           # then those channels will not be returned here.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_get_busy(self):
 
 
           # pygame.mixer.get_busy(): return bool
           # test if any sound is being mixed
-          # 
+          #
           # Returns True if the mixer is busy mixing any channels. If the mixer
           # is idle then this return False.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_init(self):
 
 
           # pygame.mixer.init(frequency=22050, size=-16, channels=2,
           # buffer=3072): return None
-          # 
+          #
           # initialize the mixer module
-          # 
+          #
           # Initialize the mixer module for Sound loading and playback. The
           # default arguments can be overridden to provide specific audio
           # mixing. The size argument represents how many bits are used for each
           # audio sample. If the value is negative then signed sample values
           # will be used. Positive values mean unsigned audio samples will be
           # used.
-          # 
+          #
           # The channels argument is used to specify whether to use mono or
           # stereo.  1 for mono and 2 for stereo. No other values are supported.
-          # 
+          #
           # The buffer argument controls the number of internal samples used in
           # the sound mixer. The default value should work for most cases. It
           # can be lowered to reduce latency, but sound dropout may occur. It
           # can be raised to larger values to ensure playback never skips, but
           # it will impose latency on sound playback. The buffer size must be a
           # power of two.
-          # 
+          #
           # Some platforms require the pygame.mixer module to be initialized
           # after the display modules have initialized. The top level
           # pygame.init() takes care of this automatically, but cannot pass any
           # arguments to the mixer init. To solve this, mixer has a function
           # pygame.mixer.pre_init() to set the proper defaults before the
           # toplevel init is used.
-          # 
+          #
           # It is safe to call this more than once, but after the mixer is
           # initialized you cannot change the playback arguments without first
           # calling pygame.mixer.quit().
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_pause(self):
 
 
           # pygame.mixer.pause(): return None
           # temporarily stop playback of all sound channels
-          # 
+          #
           # This will temporarily stop all playback on the active mixer
           # channels. The playback can later be resumed with
           # pygame.mixer.unpause()
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_pre_init(self):
 
 
           # pygame.mixer.pre_init(frequency=0, size=0, channels=0,
           # buffersize=0): return None
-          # 
+          #
           # preset the mixer init arguments
-          # 
+          #
           # Any nonzero arguments change the default values used when the real
           # pygame.mixer.init() is called. The best way to set custom mixer
           # playback values is to call pygame.mixer.pre_init() before calling
           # the top level pygame.init().
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_set_reserved(self):
 
 
           # pygame.mixer.set_reserved(count): return None
           # reserve channels from being automatically used
-          # 
+          #
           # The mixer can reserve any number of channels that will not be
           # automatically selected for playback by Sounds. If sounds are
           # currently playing on the reserved channels they will not be stopped.
-          # 
+          #
           # This allows the application to reserve a specific number of channels
           # for important sounds that must not be dropped or have a guaranteed
           # channel to play on.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_stop(self):
 
 
           # pygame.mixer.stop(): return None
           # stop playback of all sound channels
-          # 
-          # This will stop all playback of all active mixer channels. 
+          #
+          # This will stop all playback of all active mixer channels.
 
-        self.fail() 
+        self.fail()
 
     def todo_test_unpause(self):
 
 
           # pygame.mixer.unpause(): return None
           # resume paused playback of sound channels
-          # 
-          # This will resume all active sound channels after they have been paused. 
+          #
+          # This will resume all active sound channels after they have been paused.
 
-        self.fail() 
+        self.fail()
 
 ############################## CHANNEL CLASS TESTS #############################
 
 
           # pygame.mixer.Channel(id): return Channel
           # Create a Channel object for controlling playback
-          # 
+          #
           # Return a Channel object for one of the current channels. The id must
           # be a value from 0 to the value of pygame.mixer.get_num_channels().
-          # 
+          #
           # The Channel object can be used to get fine control over the playback
           # of Sounds. A channel can only playback a single Sound at time. Using
           # channels is entirely optional since pygame can manage them by
           # default.
-          # 
+          #
 
-        self.fail()      
+        self.fail()
 
     def todo_test_fadeout(self):
 
 
           # Channel.fadeout(time): return None
           # stop playback after fading channel out
-          # 
+          #
           # Stop playback of a channel after fading out the sound over the given
           # time argument in milliseconds.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_get_busy(self):
 
 
           # Channel.get_busy(): return bool
           # check if the channel is active
-          # 
+          #
           # Returns true if the channel is activily mixing sound. If the channel
           # is idle this returns False.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_get_endevent(self):
 
 
           # Channel.get_endevent(): return type
           # get the event a channel sends when playback stops
-          # 
+          #
           # Returns the event type to be sent every time the Channel finishes
           # playback of a Sound. If there is no endevent the function returns
           # pygame.NOEVENT.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_get_queue(self):
 
 
           # Channel.get_queue(): return Sound
           # return any Sound that is queued
-          # 
+          #
           # If a Sound is already queued on this channel it will be returned.
           # Once the queued sound begins playback it will no longer be on the
           # queue.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_get_sound(self):
 
 
           # Channel.get_sound(): return Sound
           # get the currently playing Sound
-          # 
+          #
           # Return the actual Sound object currently playing on this channel. If
           # the channel is idle None is returned.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_get_volume(self):
 
 
           # Channel.get_volume(): return value
           # get the volume of the playing channel
-          # 
+          #
           # Return the volume of the channel for the current playing sound. This
           # does not take into account stereo separation used by
           # Channel.set_volume. The Sound object also has its own volume which
           # is mixed with the channel.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_pause(self):
 
 
           # Channel.pause(): return None
           # temporarily stop playback of a channel
-          # 
+          #
           # Temporarily stop the playback of sound on a channel. It can be
           # resumed at a later time with Channel.unpause()
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_play(self):
 
 
           # Channel.play(Sound, loops=0, maxtime=0, fade_ms=0): return None
           # play a Sound on a specific Channel
-          # 
+          #
           # This will begin playback of a Sound on a specific Channel. If the
           # Channel is currently playing any other Sound it will be stopped.
-          # 
+          #
           # The loops argument has the same meaning as in Sound.play(): it is
           # the number of times to repeat the sound after the first time. If it
           # is 3, the sound will be played 4 times (the first time, then three
           # more). If loops is -1 then the playback will repeat indefinitely.
-          # 
+          #
           # As in Sound.play(), the maxtime argument can be used to stop
           # playback of the Sound after a given number of milliseconds.
-          # 
-          # As in Sound.play(), the fade_ms argument can be used fade in the sound. 
+          #
+          # As in Sound.play(), the fade_ms argument can be used fade in the sound.
 
-        self.fail() 
+        self.fail()
 
     def todo_test_queue(self):
 
 
           # Channel.queue(Sound): return None
           # queue a Sound object to follow the current
-          # 
+          #
           # When a Sound is queued on a Channel, it will begin playing
           # immediately after the current Sound is finished. Each channel can
           # only have a single Sound queued at a time. The queued Sound will
           # only play if the current playback finished automatically. It is
           # cleared on any other call to Channel.stop() or Channel.play().
-          # 
+          #
           # If there is no sound actively playing on the Channel then the Sound
           # will begin playing immediately.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_set_endevent(self):
 
           # Channel.set_endevent(): return None
           # Channel.set_endevent(type): return None
           # have the channel send an event when playback stops
-          # 
+          #
           # When an endevent is set for a channel, it will send an event to the
           # pygame queue every time a sound finishes playing on that channel
           # (not just the first time). Use pygame.event.get() to retrieve the
           # endevent once it's sent.
-          # 
+          #
           # Note that if you called Sound.play(n) or Channel.play(sound,n), the
           # end event is sent only once: after the sound has been played "n+1"
           # times (see the documentation of Sound.play).
-          # 
+          #
           # If Channel.stop() or Channel.play() is called while the sound was
           # still playing, the event will be posted immediately.
-          # 
+          #
           # The type argument will be the event id sent to the queue. This can
           # be any valid event type, but a good choice would be a value between
           # pygame.locals.USEREVENT and pygame.locals.NUMEVENTS. If no type
           # argument is given then the Channel will stop sending endevents.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_set_volume(self):
 
           # Channel.set_volume(value): return None
           # Channel.set_volume(left, right): return None
           # set the volume of a playing channel
-          # 
+          #
           # Set the volume (loudness) of a playing sound. When a channel starts
           # to play its volume value is reset. This only affects the current
           # sound. The value argument is between 0.0 and 1.0.
-          # 
+          #
           # If one argument is passed, it will be the volume of both speakers.
           # If two arguments are passed and the mixer is in stereo mode, the
           # first argument will be the volume of the left speaker and the second
           # will be the volume of the right speaker. (If the second argument is
           # None, the first argument will be the volume of both speakers.)
-          # 
+          #
           # If the channel is playing a Sound on which set_volume() has also
           # been called, both calls are taken into account. For example:
-          # 
+          #
           #     sound = pygame.mixer.Sound("s.wav")
           #     channel = s.play()      # Sound plays at full volume by default
           #     sound.set_volume(0.9)   # Now plays at 90% of full volume.
           #     sound.set_volume(0.6)   # Now plays at 60% (previous value replaced).
           #     channel.set_volume(0.5) # Now plays at 30% (0.6 * 0.5).
 
-        self.fail() 
+        self.fail()
 
     def todo_test_stop(self):
 
 
           # Channel.stop(): return None
           # stop playback on a Channel
-          # 
+          #
           # Stop sound playback on a channel. After playback is stopped the
           # channel becomes available for new Sounds to play on it.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_unpause(self):
 
 
           # Channel.unpause(): return None
           # resume pause playback of a channel
-          # 
-          # Resume the playback on a paused channel. 
+          #
+          # Resume the playback on a paused channel.
 
-        self.fail() 
+        self.fail()
 
 ############################### SOUND CLASS TESTS ##############################
 
 
           # Sound.fadeout(time): return None
           # stop sound playback after fading out
-          # 
+          #
           # This will stop playback of the sound after fading it out over the
           # time argument in milliseconds. The Sound will fade and stop on all
           # actively playing channels.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_get_length(self):
 
 
           # Sound.get_length(): return seconds
           # get the length of the Sound
-          # 
-          # Return the length of this Sound in seconds. 
+          #
+          # Return the length of this Sound in seconds.
 
-        self.fail() 
+        self.fail()
 
     def todo_test_get_num_channels(self):
 
 
           # Sound.get_num_channels(): return count
           # count how many times this Sound is playing
-          # 
-          # Return the number of active channels this sound is playing on. 
+          #
+          # Return the number of active channels this sound is playing on.
 
-        self.fail() 
+        self.fail()
 
     def todo_test_get_volume(self):
 
 
           # Sound.get_volume(): return value
           # get the playback volume
-          # 
-          # Return a value from 0.0 to 1.0 representing the volume for this Sound. 
+          #
+          # Return a value from 0.0 to 1.0 representing the volume for this Sound.
 
-        self.fail() 
+        self.fail()
 
     def todo_test_play(self):
 
 
           # Sound.play(loops=0, maxtime=0, fade_ms=0): return Channel
           # begin sound playback
-          # 
+          #
           # Begin playback of the Sound (i.e., on the computer's speakers) on an
           # available Channel. This will forcibly select a Channel, so playback
           # may cut off a currently playing sound if necessary.
-          # 
+          #
           # The loops argument controls how many times the sample will be
           # repeated after being played the first time. A value of 5 means that
           # the sound will be played once, then repeated five times, and so is
           # Sound is not repeated, and so is only played once. If loops is set
           # to -1 the Sound will loop indefinitely (though you can still call
           # stop() to stop it).
-          # 
+          #
           # The maxtime argument can be used to stop playback after a given
           # number of milliseconds.
-          # 
+          #
           # The fade_ms argument will make the sound start playing at 0 volume
           # and fade up to full volume over the time given. The sample may end
           # before the fade-in is complete.
-          # 
-          # This returns the Channel object for the channel that was selected. 
+          #
+          # This returns the Channel object for the channel that was selected.
 
-        self.fail() 
+        self.fail()
 
     def todo_test_set_volume(self):
 
 
           # Sound.set_volume(value): return None
           # set the playback volume for this Sound
-          # 
+          #
           # This will set the playback volume (loudness) for this Sound. This
           # will immediately affect the Sound if it is playing. It will also
           # affect any future playback of this Sound. The argument is a value
           # from 0.0 to 1.0.
-          # 
+          #
 
-        self.fail() 
+        self.fail()
 
     def todo_test_stop(self):
 
 
           # Sound.stop(): return None
           # stop sound playback
-          # 
-          # This will stop the playback of this Sound on any active Channels. 
+          #
+          # This will stop the playback of this Sound on any active Channels.
 
-        self.fail() 
+        self.fail()
 
 ##################################### MAIN #####################################
 

File test/pixelarray_test.py

             del ar
             if sf.mustlock ():
                 self.assertFalse (sf.get_locked ())
- 
+
     def test_as_class (self):
         # Check general new-style class freatures.
         sf = pygame.Surface ((2, 3), 0, 32)
         del ar
         gc.collect ()
         self.assertTrue (r() is None)
-        
+
     # Sequence interfaces
     def test_get_column (self):
         for bpp in (8, 16, 24, 32):
                 self.assertEqual (ar2, mapped_fg_color_y,
                                   "ar[1][%i] == %i, mapped_fg_color_y == %i" %
                                   (y, ar2, mapped_fg_color_y))
-                
+
             sf.set_at ((1, 1), bg_color)
             for x in xrange_ (w):
                 ar2 = ar.__getitem__ (x).__getitem__ (1)
 
             ar2 = ar.__getitem__ (0).__getitem__ (0)
             self.assertEqual (ar2, mapped_bg_color, "bpp = %i" % (bpp,))
-        
+
             ar2 = ar.__getitem__ (1).__getitem__ (0)
             self.assertEqual (ar2, mapped_fg_color_y, "bpp = %i" % (bpp,))
-            
+
             ar2 = ar.__getitem__ (-4).__getitem__ (1)
             self.assertEqual (ar2, mapped_fg_color_x, "bpp = %i" % (bpp,))
-        
+
             ar2 = ar.__getitem__ (-4).__getitem__ (5)
             self.assertEqual (ar2, mapped_bg_color, "bpp = %i" % (bpp,))
 
 
             ar.__getitem__ (1).__setitem__ (1, (128, 128, 128))
             self.assertEqual (ar[1][1], sf.map_rgb ((128, 128, 128)))
-            
+
             ar.__getitem__(-1).__setitem__ (-1, (128, 128, 128))
             self.assertEqual (ar[9][19], sf.map_rgb ((128, 128, 128)))
-            
+
             ar.__getitem__ (-2).__setitem__ (-2, (128, 128, 128))
             self.assertEqual (ar[8][-2], sf.map_rgb ((128, 128, 128)))
 
             ar.__setitem__ (2, (128, 128, 128))
             self.assertEqual (ar[2][0], sf.map_rgb ((128, 128, 128)))
             self.assertEqual (ar[2][1], sf.map_rgb ((128, 128, 128)))
-        
+
             ar.__setitem__ (-1, (0, 255, 255))
             self.assertEqual (ar[5][0], sf.map_rgb ((0, 255, 255)))
             self.assertEqual (ar[-1][1], sf.map_rgb ((0, 255, 255)))
-        
+
             ar.__setitem__ (-2, (255, 255, 0))
             self.assertEqual (ar[4][0], sf.map_rgb ((255, 255, 0)))
             self.assertEqual (ar[-2][1], sf.map_rgb ((255, 255, 0)))
-        
+
             # Test list assignment.
             ar.__setitem__ (0, [(255, 255, 255)] * 8)
             self.assertEqual (ar[0][0], sf.map_rgb ((255, 255, 255)))
                                ((204, 0, 204), (17, 17, 17), (204, 0, 204),
                                 (17, 17, 17), (204, 0, 204), (17, 17, 17),
                                 (204, 0, 204), (17, 17, 17)))
-        
+
             # Test pixel array assignment.
             ar.__setitem__ (1, ar2.__getitem__ (3))
             self.assertEqual (ar[1][0], sf.map_rgb ((0, 255, 255)))
             self.assertEqual (ar[0:0], None)
             self.assertEqual (ar[5:5], None)
             self.assertEqual (ar[9:9], None)
-        
+
             # Has to resolve to ar[7:8]
             self.assertEqual (len (ar[-3:-2]), 1)      # 2D
             self.assertEqual (len (ar[-3:-2][0]), 20)  # 1D
             self.assertEqual (ar[2,::2][0], 2)
             self.assertEqual (ar[2,::2][1], 2)
             self.assertEqual (ar[2,::2][2], 2)
-            
+
             # Should create a 3x3 array of [0,2,4]
             ar2 = ar[::2,::2]
             self.assertEqual (len (ar2), 3)
             self.assertEqual (ar2.shape, sf2.get_size ())
             sf2 = pygame.Surface ((7, 1), 0, 32)
             ar2 = pygame.PixelArray (sf2)
-            self.assertEqual (ar2.shape, sf2.get_size ()) 
+            self.assertEqual (ar2.shape, sf2.get_size ())
 
             # Array has a single ellipsis subscript: the identity operator
             ar2 = ar[...]
             self.assertEqual (ar[0,0], sf.map_rgb ((0, 255, 0)))
             self.assertEqual (ar[1,0], sf.map_rgb ((0, 255, 0)))
             self.assertEqual (ar[-1,-1], sf.map_rgb ((0, 255, 0)))
-            
+
     def test_pixels_field(self):
         for bpp in [1, 2, 3, 4]:
             sf = pygame.Surface ((11, 7), 0, bpp * 8)
             self.assertEqual (ar[3][6], oval)
             self.assertEqual (ar[8][9], rval)
             self.assertEqual (ar[9][9], oval)
-            
+
             ar[::2].replace ((0, 0, 255), (255, 0, 0), weights=(10, 20, 50))
             self.assertEqual (ar[0][0], oval)
             self.assertEqual (ar[2][3], oval)
                 ar[i % w, i // w] = i
             ar[:,:] = ar[::-1,:]
             for i in range (w * h):
-                self.assertEqual (ar[max_x - i % w, i // w], i) 
+                self.assertEqual (ar[max_x - i % w, i // w], i)
             ar = pygame.PixelArray (sf)
             for i in range (w * h):
                 ar[i % w, i // w] = i
             ar[:,:] = ar[:,::-1]
             for i in range (w * h):
-                self.assertEqual (ar[i % w, max_y - i // w ], i) 
+                self.assertEqual (ar[i % w, max_y - i // w ], i)
             ar = pygame.PixelArray (sf)
             for i in range(w * h):
                 ar[i % w, i // w] = i
             ar[:,:] = ar[::-1,::-1]
             for i in range (w * h):
-                self.assertEqual (ar[max_x - i % w, max_y - i // w], i) 
+                self.assertEqual (ar[max_x - i % w, max_y - i // w], i)
 
     def test_color_value (self):
         # Confirm that a PixelArray slice assignment distinguishes between
         self.assertEqual (ar2D.shape, (1, w))
         for x in range (2):
             self.assertEqual (ar1D[x], ar2D[0, x])
- 
+
     def test_length_1_dimension_broadcast (self):
         w = 5
         sf = pygame.Surface ((w, w), 0, 32)

File test/surface_test.py

         seglen, segaddr = get_write_buffer(v, 7)
         self.assertEqual(segaddr, s._pixels_address + s.get_bytesize() * 7)
         self.assertEqual(seglen, s.get_bytesize())
-        
+
     def test_set_colorkey(self):
 
         # __doc__ (as of 2008-06-25) for pygame.surface.Surface.set_colorkey:

File test/test_utils/buftools.py

         self.assertEqual(m.itemsize, itemsize)
         self.assertEqual(m.shape, shape)
         self.assertEqual(m.strides, strides)
-        
-        
+
+
 if __name__ == '__main__':
     unittest.main()