Anonymous avatar Anonymous committed 406c144

Merged trunk 1993-2052

Comments (0)

Files changed (101)

 _camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(SDL) $(DEBUG)
 pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
 
-#proposed SDL_gfx module backported from pgreloaded. requires SDL_gfx.
-#if accepted, then move GFX def to StartConfig section and add SDL_gfx
-#search to configure modules for Unix, Darwin and Windows.
-#GFX = -lSDL_gfx
-#gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG)
-
-#GFX = src/SDL_gfx/SDL_gfxPrimitives.c 
+GFX = src/SDL_gfx/SDL_gfxPrimitives.c 
 #GFX = src/SDL_gfx/SDL_gfxBlitFunc.c src/SDL_gfx/SDL_gfxPrimitives.c 
-#gfxdraw src/gfxdraw.c $(SDL) src/SDL_gfx/SDL_gfxPrimitives.c $(DEBUG)
+gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG)
 
 
 
 # BUG    = fixed a bug that was (or could have been) crashing
 #
 #
+[SVN 2047] May 1, 2009
+    Merge python3 branch back into trunk. This allows a minimal Pygame
+    system to be built for Python 3. It also improves error checking
+    in module init functions.
+
 [SVN 1952] Feb 22, 2009
     Added Surface.scroll method along with the scroll.py example.
 

bdist_mpkg_support.py

 except pkg_resources.DistributionNotFound:
     raise ImportError
 
+try:
+    unicode
+except NameError:
+    def unicode(s):
+        return s
+
 FRAMEWORKS = ['SDL', 'SDL_ttf', 'SDL_image', 'SDL_mixer', 'smpeg']
 
 CUSTOM_SCHEMES = dict(
     examples=dict(
-        description=u'(Optional) pygame example code',
+        description=unicode('(Optional) pygame example code'),
         prefix='/Developer/Python/pygame/Examples',
         source='examples',
     ),
     docs=dict(
-        description=u'(Optional) pygame documentation',
+        description=unicode('(Optional) pygame documentation'),
         prefix='/Developer/Python/pygame/Documentation',
         source='docs',
     ),
 
 for framework in FRAMEWORKS:
     CUSTOM_SCHEMES[framework] = dict(
-        description=u'(Required) %s.framework' % (framework,),
+        description=unicode('(Required) %s.framework') % (framework,),
         prefix='/Library/Frameworks/%s.framework' % (framework,),
         source='/Library/Frameworks/%s.framework' % (framework,),
     )
 
 import msysio
 import mingwcfg
-import sys, os, shutil, string
+import sys, os, shutil
 
 def print_(*args, **kwds):
     """Simular to the Python 3.0 print function"""
 def confirm(message):
     "ask a yes/no question, return result"
     reply = msysio.raw_input_("\n%s [Y/n]:" % message)
-    if reply and string.lower(reply[0]) == 'n':
-        return 0
-    return 1
+    if reply and reply[0].lower() == 'n':
+        return False
+    return True
 
 def is_msys_mingw():
     """Return true if this in an MinGW/MSYS build
 
 def main():
     additional_platform_setup = []
-    if sys.platform == 'win32' and not is_msys_mingw():
+    if (sys.platform == 'win32' and
+        # Note that msys builds supported for 2.6 and greater. Use prebuilt.
+        (sys.version_info >= (2, 6) or not is_msys_mingw())):
         print_('Using WINDOWS configuration...\n')
         import config_win as CFG
     elif sys.platform == 'win32':
 """Config on Unix"""
 
-import os, sys, string
+import os, sys
 from glob import glob
 from distutils.sysconfig import get_python_inc
 
+# Python 2.x/3.x compatibility
+try:
+    raw_input
+except NameError:
+    raw_input = input
+
 configcommand = os.environ.get('SDL_CONFIG', 'sdl-config',)
 configcommand = configcommand + ' --version --cflags --libs'
 localbase = os.environ.get('LOCALBASE', '')
 def confirm(message):
     "ask a yes/no question, return result"
     reply = raw_input('\n' + message + ' [Y/n]:')
-    if reply and string.lower(reply[0]) == 'n':
+    if reply and (reply[0].lower()) == 'n':
         return 0
     return 1
 
         self.cflags = ''
         try:
             config = os.popen(command + ' --version --cflags --libs').readlines()
-            flags = string.split(string.join(config[1:], ' '))
+            flags = ' '.join(config[1:]).split()
 
             # remove this GNU_SOURCE if there... since python has it already,
             #   it causes a warning.
             if '-D_GNU_SOURCE=1' in flags:
                 flags.remove('-D_GNU_SOURCE=1')
-            self.ver = string.strip(config[0])
+            self.ver = config[0].strip()
             if minver and self.ver < minver:
                 err= 'WARNING: requires %s version %s (%s found)' % (self.name, self.ver, minver)
-                raise ValueError, err
+                raise ValueError(err)
             self.found = 1
             self.cflags = ''
             for f in flags:
                 elif f[:3] == '-Wl':
                     self.cflags += '-Xlinker ' + f + ' '
             if self.name == 'SDL':
-		inc = '-I' + '/usr/X11R6/include'
-		self.cflags = inc + ' ' + self.cflags
+                inc = '-I' + '/usr/X11R6/include'
+                self.cflags = inc + ' ' + self.cflags
         except:
-            print 'WARNING: "%s" failed!' % command    
+            print ('WARNING: "%s" failed!' % command)
             self.found = 0
             self.ver = '0'
             self.libs = defaultlibs
 
     def configure(self, incdirs, libdir):
         if self.found:
-            print self.name + '        '[len(self.name):] + ': found ' + self.ver
+            print (self.name + '        '[len(self.name):] + ': found ' + self.ver)
             self.found = 1
         else:
-            print self.name + '        '[len(self.name):] + ': not found'
+            print (self.name + '        '[len(self.name):] + ': not found')
 
 class Dependency:
     def __init__(self, name, checkhead, checklib, libs):
     
     def configure(self, incdirs, libdirs):
         incname = self.checkhead
-        libnames = self.checklib, string.lower(self.name)
+        libnames = self.checklib, self.name.lower()
         
         if incname:
             for dir in incdirs:
                     self.lib_dir = dir
 
         if (incname and self.lib_dir and self.inc_dir) or (not incname and self.lib_dir):
-            print self.name + '        '[len(self.name):] + ': found'
+            print (self.name + '        '[len(self.name):] + ': found')
             self.found = 1
         else:
-            print self.name + '        '[len(self.name):] + ': not found'
+            print (self.name + '        '[len(self.name):] + ': not found')
 
 class DependencyPython:
     def __init__(self, name, module, header):
             else:
                 self.inc_dir = os.path.split(fullpath)[0]
         if self.found:
-            print self.name + '        '[len(self.name):] + ': found', self.ver
+            print (self.name + '        '[len(self.name):] + ': found', self.ver)
         else:
-            print self.name + '        '[len(self.name):] + ': not found'
+            print (self.name + '        '[len(self.name):] + ': not found')
 
 sdl_lib_name = 'SDL'
 
 def main():
-    print '\nHunting dependencies...'
+    print ('\nHunting dependencies...')
     DEPS = [
         DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2', ['sdl']),
         Dependency('FONT', 'SDL_ttf.h', 'libSDL_ttf.so', ['SDL_ttf']),
         Dependency('PORTTIME', 'porttime.h', 'libporttime.so', ['porttime']),
         #Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']),
     ]
-
     if not DEPS[0].found:
-        print 'Unable to run "sdl-config". Please make sure a development version of SDL is installed.'
+        print ('Unable to run "sdl-config". Please make sure a development version of SDL is installed.')
         raise SystemExit
 
     if localbase:
     incdirs += ["/usr/local"+d for d in origincdirs]
     libdirs += ["/usr/local"+d for d in origlibdirs]
 
-    for arg in string.split(DEPS[0].cflags):
+    for arg in DEPS[0].cflags.split():
         if arg[:2] == '-I':
             incdirs.append(arg[2:])
         elif arg[:2] == '-L':
     return DEPS
 
 if __name__ == '__main__':
-    print """This is the configuration subscript for Unix.
-Please run "config.py" for full configuration."""
+    print ("""This is the configuration subscript for Unix.
+Please run "config.py" for full configuration.""")
 
 from glob import glob
 from distutils.sysconfig import get_python_inc
 
+try:
+    raw_input
+except NameError:
+    raw_input = input
+
 huntpaths = ['..', '..\\..', '..\\*', '..\\..\\*']
 
 
         self.inc_dir = None
         self.lib_dir = None
         self.libs = libs
-        self.found = 0
+        self.found = False
         self.cflags = ''
                  
     def hunt(self):
 
     def choosepath(self):
         if not self.paths:
-            print 'Path for ', self.name, 'not found.'
-            if self.required: print 'Too bad that is a requirement! Hand-fix the "Setup"'
+            print ("Path for %s not found." % self.name)
+            if self.required:
+                print ('Too bad that is a requirement! Hand-fix the "Setup"')
         elif len(self.paths) == 1:
             self.path = self.paths[0]
-            print 'Path for '+self.name+':', self.path
+            print ("Path for %s:' % self.name")
         else:
-            print 'Select path for '+self.name+':'
+            print ("Select path for %s:" % self.name)
             for i in range(len(self.paths)):
-                print '  ', i+1, '=', self.paths[i]
-            print '  ', 0, '= <Nothing>'
-            choice = raw_input('Select 0-'+`len(self.paths)`+' (1=default):')
+                print ("  %i=%s" % (i + 1, self.paths[i]))
+            print ("  %i = <Nothing>" % 0)
+            choice = raw_input("Select 0-%i (1=default):" % len(self.paths))
             if not choice: choice = 1
             else: choice = int(choice)
             if(choice):
         self.hunt()
         self.choosepath()
         if self.path:
-            self.found = 1
+            self.found = True
             self.inc_dir = self.findhunt(self.path, Dependency.inc_hunt)
             self.lib_dir = self.findhunt(self.path, Dependency.lib_hunt)
 
         self.inc_dir = ''
         self.libs = []
         self.cflags = ''
-        self.found = 0
+        self.found = False
         self.ver = '0'
         self.module = module
         self.header = header
  
     def configure(self):
-        self.found = 1
+        self.found = True
         if self.module:
             try:
                 self.ver = __import__(self.module).__version__
             except ImportError:
-                self.found = 0
+                self.found = False
         if self.found and self.header:
             fullpath = os.path.join(get_python_inc(0), self.header)
             if not os.path.isfile(fullpath):
             else:
                 self.inc_dir = os.path.split(fullpath)[0]
         if self.found:
-            print self.name + '        '[len(self.name):] + ': found', self.ver
+            print ("%-8.8s: found %s" % (self.name, self.ver))
         else:
-            print self.name + '        '[len(self.name):] + ': not found'
+            print ("%-8.8s: not found" % self.name)
 
 
 class DependencyDLL(Dependency):
         self.lib_name = lib
         self.test = re.compile(dll_regex, re.I).match
         self.lib_dir = '_'
-        self.found = 1
+        self.found = True
         self.link = link
 
     def configure(self):
                     if self.test(e) and os.path.isfile(os.path.join(path, e)):
                         # Found
                         self.lib_dir = os.path.join(path, e).replace('\\', '/')
-                        print "DLL for %s is %s" % (self.lib_name, self.lib_dir)
+                        print ("DLL for %s is %s" % (self.lib_name, self.lib_dir))
                         return
-        print "DLL for %s not found" % self.lib_name
+        print ("DLL for %s not found" % self.lib_name)
 
 class DependencyWin(object):
     def __init__(self, name, cflags):
         self.inc_dir = None
         self.lib_dir = None
         self.libs = []
-        self.found = 1
+        self.found = True
         self.cflags = cflags
         
     def configure(self):
     return list(DEPS)
 
 if __name__ == '__main__':
-    print """This is the configuration subscript for Windows.
-Please run "config.py" for full configuration."""
+    print ("""This is the configuration subscript for Windows.
+Please run "config.py" for full configuration.""")
 

docs/ref/camera.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/cdrom.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/color.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/cursors.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/display.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/draw.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/event.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;
     VIDEORESIZE      size, w, h
     VIDEOEXPOSE      none
     USEREVENT        code
-</pre>
+</pre><p>Events support equality comparison. Two events are equal if they are the same type and have identical attribute values. Inequality checks also work. </p>
 <!--COMMENTS:pygame.event--> &nbsp;<br> 
 
 

docs/ref/examples.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;
 <big><b>pygame.examples.vgrade.main</big></b><br><ul>
   <i>display a vertical gradient</i><br>
   <tt>pygame.examples.vgrade.main(): return None</tt><br>
-<p>Demonstrates creating a vertical gradient with Numeric python. The app will create a new gradient every half second and report the time needed to create and display the image. If you're not prepared to start working with the Numeric arrays, don't worry about the source for this one :] </p>
+<p>Demonstrates creating a vertical gradient with NumPy python. The app will create a new gradient every half second and report the time needed to create and display the image. If you're not prepared to start working with the NumPy arrays, don't worry about the source for this one :] </p>
 <!--COMMENTS:pygame.examples.vgrade.main--> &nbsp;<br> 
 <br></ul>
 
   <i>play various sndarray effects</i><br>
   <tt>pygame.examples.sound_array_demos.main(arraytype=None): return None</tt><br>
 <p>If arraytype is provided then use that array package. Valid values are 'numeric' or 'numpy'. Otherwise default to NumPy, or fall back on Numeric if NumPy is not installed. </p>
-<p>Uses sndarray and MumPy ( or Numeric) to create offset faded copies of the original sound. Currently it just uses hardcoded values for the number of echos and the delay. Easy for you to recreate as needed. Run as a program <tt>sound_array_demos.py</tt> takes an optional command line option, --numpy or --numeric, specifying which array package to use. </p>
+<p>Uses sndarray and NumPy ( or Numeric) to create offset faded copies of the original sound. Currently it just uses hardcoded values for the number of echos and the delay. Easy for you to recreate as needed. Run as a program <tt>sound_array_demos.py</tt> takes an optional command line option, --numpy or --numeric, specifying which array package to use. </p>
 <!--COMMENTS:pygame.examples.sound_array_demos.main--> &nbsp;<br> 
 <br></ul>
 

docs/ref/font.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/image.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/index.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;
 
 <li><a href="pygame.html#pygame">pygame</a> - <font size=-1>the top level pygame package</font></li>
 <ul>
-<li><a href="pygame.html#pygame.error">pygame.error</a> - <font size=-1>standard pygame exception</font></li>
-<li><a href="pygame.html#pygame.get_error">pygame.get_error</a> - <font size=-1>get the current error message</font></li>
-<li><a href="pygame.html#pygame.get_sdl_byteorder">pygame.get_sdl_byteorder</a> - <font size=-1>get the byte order of SDL</font></li>
-<li><a href="pygame.html#pygame.get_sdl_version">pygame.get_sdl_version</a> - <font size=-1>get the version number of SDL</font></li>
-<li><a href="pygame.html#pygame.init">pygame.init</a> - <font size=-1>initialize all imported pygame modules</font></li>
+<li><a href="color.html#pygame.Color">pygame.Color</a> - <font size=-1>pygame object for color representations</font></li>
+<ul>
+<li><a href="color.html#Color.a">Color.a</a> - <font size=-1>Gets or sets the alpha value of the Color.</font></li>
+<li><a href="color.html#Color.b">Color.b</a> - <font size=-1>Gets or sets the blue value of the Color.</font></li>
+<li><a href="color.html#Color.cmy">Color.cmy</a> - <font size=-1>Gets or sets the CMY representation of the Color.</font></li>
+<li><a href="color.html#Color.correct_gamma">Color.correct_gamma</a> - <font size=-1>Applies a certain gamma value to the Color.</font></li>
+<li><a href="color.html#Color.g">Color.g</a> - <font size=-1>Gets or sets the green value of the Color.</font></li>
+<li><a href="color.html#Color.hsla">Color.hsla</a> - <font size=-1>Gets or sets the HSLA representation of the Color.</font></li>
+<li><a href="color.html#Color.hsva">Color.hsva</a> - <font size=-1>Gets or sets the HSVA representation of the Color.</font></li>
+<li><a href="color.html#Color.i1i2i3">Color.i1i2i3</a> - <font size=-1>Gets or sets the I1I2I3 representation of the Color.</font></li>
+<li><a href="color.html#Color.normalize">Color.normalize</a> - <font size=-1>Returns the normalized RGBA values of the Color.</font></li>
+<li><a href="color.html#Color.r">Color.r</a> - <font size=-1>Gets or sets the red value of the Color.</font></li>
+</ul>
+<li><a href="overlay.html#pygame.Overlay">pygame.Overlay</a> - <font size=-1>pygame object for video overlay graphics</font></li>
+<ul>
+<li><a href="overlay.html#Overlay.display">Overlay.display</a> - <font size=-1>set the overlay pixel data</font></li>
+<li><a href="overlay.html#Overlay.get_hardware">Overlay.get_hardware</a> - <font size=-1>test if the Overlay is hardware accelerated</font></li>
+<li><a href="overlay.html#Overlay.set_location">Overlay.set_location</a> - <font size=-1>control where the overlay is displayed</font></li>
+</ul>
+<li><a href="pixelarray.html#pygame.PixelArray">pygame.PixelArray</a> - <font size=-1>pygame object for direct pixel access of surfaces</font></li>
+<ul>
+<li><a href="pixelarray.html#PixelArray.compare">PixelArray.compare</a> - <font size=-1>Compares the PixelArray with another one.</font></li>
+<li><a href="pixelarray.html#PixelArray.extract">PixelArray.extract</a> - <font size=-1>Extracts the passed color from the PixelArray.</font></li>
+<li><a href="pixelarray.html#PixelArray.make_surface">PixelArray.make_surface</a> - <font size=-1>Creates a new Surface from the current PixelArray.</font></li>
+<li><a href="pixelarray.html#PixelArray.replace">PixelArray.replace</a> - <font size=-1>Replaces the passed color in the PixelArray with another one.</font></li>
+<li><a href="pixelarray.html#PixelArray.surface">PixelArray.surface</a> - <font size=-1>Gets the Surface the PixelArray uses.</font></li>
+</ul>
+<li><a href="rect.html#pygame.Rect">pygame.Rect</a> - <font size=-1>pygame object for storing rectangular coordinates</font></li>
+<ul>
+<li><a href="rect.html#Rect.clamp">Rect.clamp</a> - <font size=-1>moves the rectangle inside another</font></li>
+<li><a href="rect.html#Rect.clamp_ip">Rect.clamp_ip</a> - <font size=-1>moves the rectangle inside another, in place</font></li>
+<li><a href="rect.html#Rect.clip">Rect.clip</a> - <font size=-1>crops a rectangle inside another</font></li>
+<li><a href="rect.html#Rect.collidedict">Rect.collidedict</a> - <font size=-1>test if one rectangle in a dictionary intersects</font></li>
+<li><a href="rect.html#Rect.collidedictall">Rect.collidedictall</a> - <font size=-1>test if all rectangles in a dictionary intersect</font></li>
+<li><a href="rect.html#Rect.collidelist">Rect.collidelist</a> - <font size=-1>test if one rectangle in a list intersects</font></li>
+<li><a href="rect.html#Rect.collidelistall">Rect.collidelistall</a> - <font size=-1>test if all rectangles in a list intersect</font></li>
+<li><a href="rect.html#Rect.collidepoint">Rect.collidepoint</a> - <font size=-1>test if a point is inside a rectangle</font></li>
+<li><a href="rect.html#Rect.colliderect">Rect.colliderect</a> - <font size=-1>test if two rectangles overlap</font></li>
+<li><a href="rect.html#Rect.contains">Rect.contains</a> - <font size=-1>test if one rectangle is inside another</font></li>
+<li><a href="rect.html#Rect.copy">Rect.copy</a> - <font size=-1>copy the rectangle</font></li>
+<li><a href="rect.html#Rect.fit">Rect.fit</a> - <font size=-1>resize and move a rectangle with aspect ratio</font></li>
+<li><a href="rect.html#Rect.inflate">Rect.inflate</a> - <font size=-1>grow or shrink the rectangle size</font></li>
+<li><a href="rect.html#Rect.inflate_ip">Rect.inflate_ip</a> - <font size=-1>grow or shrink the rectangle size, in place</font></li>
+<li><a href="rect.html#Rect.move">Rect.move</a> - <font size=-1>moves the rectangle</font></li>
+<li><a href="rect.html#Rect.move_ip">Rect.move_ip</a> - <font size=-1>moves the rectangle, in place</font></li>
+<li><a href="rect.html#Rect.normalize">Rect.normalize</a> - <font size=-1>correct negative sizes</font></li>
+<li><a href="rect.html#Rect.union">Rect.union</a> - <font size=-1>joins two rectangles into one</font></li>
+<li><a href="rect.html#Rect.union_ip">Rect.union_ip</a> - <font size=-1>joins two rectangles into one, in place</font></li>
+<li><a href="rect.html#Rect.unionall">Rect.unionall</a> - <font size=-1>the union of many rectangles</font></li>
+<li><a href="rect.html#Rect.unionall_ip">Rect.unionall_ip</a> - <font size=-1>the union of many rectangles, in place</font></li>
+</ul>
+<li><a href="surface.html#pygame.Surface">pygame.Surface</a> - <font size=-1>pygame object for representing images</font></li>
+<ul>
+<li><a href="surface.html#Surface.blit">Surface.blit</a> - <font size=-1>draw one image onto another</font></li>
+<li><a href="surface.html#Surface.convert">Surface.convert</a> - <font size=-1>change the pixel format of an image</font></li>
+<li><a href="surface.html#Surface.convert_alpha">Surface.convert_alpha</a> - <font size=-1>change the pixel format of an image including per pixel alphas</font></li>
+<li><a href="surface.html#Surface.copy">Surface.copy</a> - <font size=-1>create a new copy of a Surface</font></li>
+<li><a href="surface.html#Surface.fill">Surface.fill</a> - <font size=-1>fill Surface with a solid color</font></li>
+<li><a href="surface.html#Surface.get_abs_offset">Surface.get_abs_offset</a> - <font size=-1>find the absolute position of a child subsurface inside its top level parent</font></li>
+<li><a href="surface.html#Surface.get_abs_parent">Surface.get_abs_parent</a> - <font size=-1>find the top level parent of a subsurface</font></li>
+<li><a href="surface.html#Surface.get_alpha">Surface.get_alpha</a> - <font size=-1>get the current Surface transparency value</font></li>
+<li><a href="surface.html#Surface.get_at">Surface.get_at</a> - <font size=-1>get the color value at a single pixel</font></li>
+<li><a href="surface.html#Surface.get_bitsize">Surface.get_bitsize</a> - <font size=-1>get the bit depth of the Surface pixel format</font></li>
+<li><a href="surface.html#Surface.get_bounding_rect">Surface.get_bounding_rect</a> - <font size=-1>find the smallest rect containing data</font></li>
+<li><a href="surface.html#Surface.get_buffer">Surface.get_buffer</a> - <font size=-1>acquires a buffer object for the pixels of the Surface.</font></li>
+<li><a href="surface.html#Surface.get_bytesize">Surface.get_bytesize</a> - <font size=-1>get the bytes used per Surface pixel</font></li>
+<li><a href="surface.html#Surface.get_clip">Surface.get_clip</a> - <font size=-1>get the current clipping area of the Surface</font></li>
+<li><a href="surface.html#Surface.get_colorkey">Surface.get_colorkey</a> - <font size=-1>Get the current transparent colorkey</font></li>
+<li><a href="surface.html#Surface.get_flags">Surface.get_flags</a> - <font size=-1>get the additional flags used for the Surface</font></li>
+<li><a href="surface.html#Surface.get_height">Surface.get_height</a> - <font size=-1>get the height of the Surface</font></li>
+<li><a href="surface.html#Surface.get_locked">Surface.get_locked</a> - <font size=-1>test if the Surface is current locked</font></li>
+<li><a href="surface.html#Surface.get_locks">Surface.get_locks</a> - <font size=-1>Gets the locks for the Surface</font></li>
+<li><a href="surface.html#Surface.get_losses">Surface.get_losses</a> - <font size=-1>the significant bits used to convert between a color and a mapped integer</font></li>
+<li><a href="surface.html#Surface.get_masks">Surface.get_masks</a> - <font size=-1>the bitmasks needed to convert between a color and a mapped integer</font></li>
+<li><a href="surface.html#Surface.get_offset">Surface.get_offset</a> - <font size=-1>find the position of a child subsurface inside a parent</font></li>
+<li><a href="surface.html#Surface.get_palette">Surface.get_palette</a> - <font size=-1>get the color index palette for an 8bit Surface</font></li>
+<li><a href="surface.html#Surface.get_palette_at">Surface.get_palette_at</a> - <font size=-1>get the color for a single entry in a palette</font></li>
+<li><a href="surface.html#Surface.get_parent">Surface.get_parent</a> - <font size=-1>find the parent of a subsurface</font></li>
+<li><a href="surface.html#Surface.get_pitch">Surface.get_pitch</a> - <font size=-1>get the number of bytes used per Surface row</font></li>
+<li><a href="surface.html#Surface.get_rect">Surface.get_rect</a> - <font size=-1>get the rectangular area of the Surface</font></li>
+<li><a href="surface.html#Surface.get_shifts">Surface.get_shifts</a> - <font size=-1>the bit shifts needed to convert between a color and a mapped integer</font></li>
+<li><a href="surface.html#Surface.get_size">Surface.get_size</a> - <font size=-1>get the dimensions of the Surface</font></li>
+<li><a href="surface.html#Surface.get_width">Surface.get_width</a> - <font size=-1>get the width of the Surface</font></li>
+<li><a href="surface.html#Surface.lock">Surface.lock</a> - <font size=-1>lock the Surface memory for pixel access</font></li>
+<li><a href="surface.html#Surface.map_rgb">Surface.map_rgb</a> - <font size=-1>convert a color into a mapped color value</font></li>
+<li><a href="surface.html#Surface.mustlock">Surface.mustlock</a> - <font size=-1>test if the Surface requires locking</font></li>
+<li><a href="surface.html#Surface.scroll">Surface.scroll</a> - <font size=-1>Shift the surface image in place</font></li>
+<li><a href="surface.html#Surface.set_alpha">Surface.set_alpha</a> - <font size=-1>set the alpha value for the full Surface image</font></li>
+<li><a href="surface.html#Surface.set_at">Surface.set_at</a> - <font size=-1>set the color value for a single pixel</font></li>
+<li><a href="surface.html#Surface.set_clip">Surface.set_clip</a> - <font size=-1>set the current clipping area of the Surface</font></li>
+<li><a href="surface.html#Surface.set_colorkey">Surface.set_colorkey</a> - <font size=-1>Set the transparent colorkey</font></li>
+<li><a href="surface.html#Surface.set_masks">Surface.set_masks</a> - <font size=-1>set the bitmasks needed to convert between a color and a mapped integer</font></li>
+<li><a href="surface.html#Surface.set_palette">Surface.set_palette</a> - <font size=-1>set the color palette for an 8bit Surface</font></li>
+<li><a href="surface.html#Surface.set_palette_at">Surface.set_palette_at</a> - <font size=-1>set the color for a single index in an 8bit Surface palette</font></li>
+<li><a href="surface.html#Surface.set_shifts">Surface.set_shifts</a> - <font size=-1>sets the bit shifts needed to convert between a color and a mapped integer</font></li>
+<li><a href="surface.html#Surface.subsurface">Surface.subsurface</a> - <font size=-1>create a new surface that references its parent</font></li>
+<li><a href="surface.html#Surface.unlock">Surface.unlock</a> - <font size=-1>unlock the Surface memory from pixel access</font></li>
+<li><a href="surface.html#Surface.unmap_rgb">Surface.unmap_rgb</a> - <font size=-1>convert a mapped integer color value into a Color</font></li>
+</ul>
 <li><a href="camera.html#pygame.camera">pygame.camera</a> - <font size=-1>pygame module for camera use</font></li>
 <ul>
 <li><a href="camera.html#pygame.camera.Camera">pygame.camera.Camera</a> - <font size=-1>load a camera</font></li>
 <li><a href="cdrom.html#pygame.cdrom.init">pygame.cdrom.init</a> - <font size=-1>initialize the cdrom module</font></li>
 <li><a href="cdrom.html#pygame.cdrom.quit">pygame.cdrom.quit</a> - <font size=-1>uninitialize the cdrom module</font></li>
 </ul>
-<li><a href="color.html#pygame.Color">pygame.Color</a> - <font size=-1>pygame object for color representations</font></li>
-<ul>
-<li><a href="color.html#Color.a">Color.a</a> - <font size=-1>Gets or sets the alpha value of the Color.</font></li>
-<li><a href="color.html#Color.b">Color.b</a> - <font size=-1>Gets or sets the blue value of the Color.</font></li>
-<li><a href="color.html#Color.cmy">Color.cmy</a> - <font size=-1>Gets or sets the CMY representation of the Color.</font></li>
-<li><a href="color.html#Color.correct_gamma">Color.correct_gamma</a> - <font size=-1>Applies a certain gamma value to the Color.</font></li>
-<li><a href="color.html#Color.g">Color.g</a> - <font size=-1>Gets or sets the green value of the Color.</font></li>
-<li><a href="color.html#Color.hsla">Color.hsla</a> - <font size=-1>Gets or sets the HSLA representation of the Color.</font></li>
-<li><a href="color.html#Color.hsva">Color.hsva</a> - <font size=-1>Gets or sets the HSVA representation of the Color.</font></li>
-<li><a href="color.html#Color.i1i2i3">Color.i1i2i3</a> - <font size=-1>Gets or sets the I1I2I3 representation of the Color.</font></li>
-<li><a href="color.html#Color.normalize">Color.normalize</a> - <font size=-1>Returns the normalized RGBA values of the Color.</font></li>
-<li><a href="color.html#Color.r">Color.r</a> - <font size=-1>Gets or sets the red value of the Color.</font></li>
-</ul>
 <li><a href="locals.html#pygame.contants">pygame.contants</a> - <font size=-1>Pygame constants</font></li>
 <ul>
 <li><a href="locals.html#display">display</a> - <font size=-1>The following constants are used by the display module and Surfaces</font></li>
 </ul>
 <li><a href="display.html#pygame.display">pygame.display</a> - <font size=-1>pygame module to control the display window and screen</font></li>
 <ul>
+<li><a href="display.html#pygame.display.Info">pygame.display.Info</a> - <font size=-1>Create a video display information object</font></li>
 <li><a href="display.html#pygame.display.flip">pygame.display.flip</a> - <font size=-1>update the full display Surface to the screen</font></li>
 <li><a href="display.html#pygame.display.get_active">pygame.display.get_active</a> - <font size=-1>true when the display is active on the display</font></li>
 <li><a href="display.html#pygame.display.get_caption">pygame.display.get_caption</a> - <font size=-1>get the current window caption</font></li>
 <li><a href="display.html#pygame.display.gl_get_attribute">pygame.display.gl_get_attribute</a> - <font size=-1>get the value for an opengl flag for the current display</font></li>
 <li><a href="display.html#pygame.display.gl_set_attribute">pygame.display.gl_set_attribute</a> - <font size=-1>request an opengl display attribute for the display mode</font></li>
 <li><a href="display.html#pygame.display.iconify">pygame.display.iconify</a> - <font size=-1>iconify the display surface</font></li>
-<li><a href="display.html#pygame.display.Info">pygame.display.Info</a> - <font size=-1>Create a video display information object</font></li>
 <li><a href="display.html#pygame.display.init">pygame.display.init</a> - <font size=-1>initialize the display module</font></li>
 <li><a href="display.html#pygame.display.list_modes">pygame.display.list_modes</a> - <font size=-1>get list of available fullscreen modes</font></li>
 <li><a href="display.html#pygame.display.mode_ok">pygame.display.mode_ok</a> - <font size=-1>pick the best color depth for a display mode</font></li>
 <li><a href="draw.html#pygame.draw.polygon">pygame.draw.polygon</a> - <font size=-1>draw a shape with any number of sides</font></li>
 <li><a href="draw.html#pygame.draw.rect">pygame.draw.rect</a> - <font size=-1>draw a rectangle shape</font></li>
 </ul>
+<li><a href="pygame.html#pygame.error">pygame.error</a> - <font size=-1>standard pygame exception</font></li>
 <li><a href="event.html#pygame.event">pygame.event</a> - <font size=-1>pygame module for interacting with events and queues</font></li>
 <ul>
+<li><a href="event.html#pygame.event.Event">pygame.event.Event</a> - <font size=-1>create a new event object</font></li>
 <li><a href="event.html#pygame.event.clear">pygame.event.clear</a> - <font size=-1>remove all events from the queue</font></li>
-<li><a href="event.html#pygame.event.Event">pygame.event.Event</a> - <font size=-1>create a new event object</font></li>
 <li><a href="event.html#pygame.event.event_name">pygame.event.event_name</a> - <font size=-1>get the string name from and event id</font></li>
 <li><a href="event.html#pygame.event.get">pygame.event.get</a> - <font size=-1>get events from the queue</font></li>
 <li><a href="event.html#pygame.event.get_blocked">pygame.event.get_blocked</a> - <font size=-1>test if a type of event is blocked from the queue</font></li>
 <li><a href="font.html#Font.set_underline">Font.set_underline</a> - <font size=-1>control if text is rendered with an underline</font></li>
 <li><a href="font.html#Font.size">Font.size</a> - <font size=-1>determine the amount of space needed to render text</font></li>
 </ul>
+<li><a href="font.html#pygame.font.SysFont">pygame.font.SysFont</a> - <font size=-1>create a Font object from the system fonts</font></li>
 <li><a href="font.html#pygame.font.get_default_font">pygame.font.get_default_font</a> - <font size=-1>get the filename of the default font</font></li>
 <li><a href="font.html#pygame.font.get_fonts">pygame.font.get_fonts</a> - <font size=-1>get all available fonts</font></li>
 <li><a href="font.html#pygame.font.get_init">pygame.font.get_init</a> - <font size=-1>true if the font module is initialized</font></li>
 <li><a href="font.html#pygame.font.init">pygame.font.init</a> - <font size=-1>initialize the font module</font></li>
 <li><a href="font.html#pygame.font.match_font">pygame.font.match_font</a> - <font size=-1>find a specific font on the system</font></li>
 <li><a href="font.html#pygame.font.quit">pygame.font.quit</a> - <font size=-1>uninitialize the font module</font></li>
-<li><a href="font.html#pygame.font.SysFont">pygame.font.SysFont</a> - <font size=-1>create a Font object from the system fonts</font></li>
 </ul>
+<li><a href="pygame.html#pygame.get_error">pygame.get_error</a> - <font size=-1>get the current error message</font></li>
+<li><a href="pygame.html#pygame.get_sdl_byteorder">pygame.get_sdl_byteorder</a> - <font size=-1>get the byte order of SDL</font></li>
+<li><a href="pygame.html#pygame.get_sdl_version">pygame.get_sdl_version</a> - <font size=-1>get the version number of SDL</font></li>
 <li><a href="image.html#pygame.image">pygame.image</a> - <font size=-1>pygame module for image transfer</font></li>
 <ul>
 <li><a href="image.html#pygame.image.frombuffer">pygame.image.frombuffer</a> - <font size=-1>create a new Surface that shares data inside a string buffer</font></li>
 <li><a href="image.html#pygame.image.save">pygame.image.save</a> - <font size=-1>save an image to disk</font></li>
 <li><a href="image.html#pygame.image.tostring">pygame.image.tostring</a> - <font size=-1>transfer image to string buffer</font></li>
 </ul>
+<li><a href="pygame.html#pygame.init">pygame.init</a> - <font size=-1>initialize all imported pygame modules</font></li>
 <li><a href="joystick.html#pygame.joystick">pygame.joystick</a> - <font size=-1>pygame module for interacting with joystick devices</font></li>
 <ul>
-<li><a href="joystick.html#pygame.joystick.get_count">pygame.joystick.get_count</a> - <font size=-1>number of joysticks on the system</font></li>
-<li><a href="joystick.html#pygame.joystick.get_init">pygame.joystick.get_init</a> - <font size=-1>true if the joystick module is initialized</font></li>
-<li><a href="joystick.html#pygame.joystick.init">pygame.joystick.init</a> - <font size=-1>initialize the joystick module</font></li>
 <li><a href="joystick.html#pygame.joystick.Joystick">pygame.joystick.Joystick</a> - <font size=-1>create a new Joystick object</font></li>
 <ul>
 <li><a href="joystick.html#Joystick.get_axis">Joystick.get_axis</a> - <font size=-1>get the current position of an axis</font></li>
 <li><a href="joystick.html#Joystick.init">Joystick.init</a> - <font size=-1>initialize the Joystick</font></li>
 <li><a href="joystick.html#Joystick.quit">Joystick.quit</a> - <font size=-1>uninitialize the Joystick</font></li>
 </ul>
+<li><a href="joystick.html#pygame.joystick.get_count">pygame.joystick.get_count</a> - <font size=-1>number of joysticks on the system</font></li>
+<li><a href="joystick.html#pygame.joystick.get_init">pygame.joystick.get_init</a> - <font size=-1>true if the joystick module is initialized</font></li>
+<li><a href="joystick.html#pygame.joystick.init">pygame.joystick.init</a> - <font size=-1>initialize the joystick module</font></li>
 <li><a href="joystick.html#pygame.joystick.quit">pygame.joystick.quit</a> - <font size=-1>uninitialize the joystick module</font></li>
 </ul>
 <li><a href="key.html#pygame.key">pygame.key</a> - <font size=-1>pygame module to work with the keyboard</font></li>
 </ul>
 <li><a href="mask.html#pygame.mask">pygame.mask</a> - <font size=-1>pygame module for image masks.</font></li>
 <ul>
-<li><a href="mask.html#pygame.mask.from_surface">pygame.mask.from_surface</a> - <font size=-1>Returns a Mask from the given surface.</font></li>
-<li><a href="mask.html#pygame.mask.from_threshold">pygame.mask.from_threshold</a> - <font size=-1>Creates a mask by thresholding Surfaces</font></li>
 <li><a href="mask.html#pygame.mask.Mask">pygame.mask.Mask</a> - <font size=-1>pygame object for representing 2d bitmasks</font></li>
 <ul>
 <li><a href="mask.html#Mask.angle">Mask.angle</a> - <font size=-1>Returns the orientation of the pixels</font></li>
 <li><a href="mask.html#Mask.scale">Mask.scale</a> - <font size=-1>Resizes a mask</font></li>
 <li><a href="mask.html#Mask.set_at">Mask.set_at</a> - <font size=-1>Sets the position in the mask given by x and y.</font></li>
 </ul>
+<li><a href="mask.html#pygame.mask.from_surface">pygame.mask.from_surface</a> - <font size=-1>Returns a Mask from the given surface.</font></li>
+<li><a href="mask.html#pygame.mask.from_threshold">pygame.mask.from_threshold</a> - <font size=-1>Creates a mask by thresholding Surfaces</font></li>
 </ul>
+<li><a href="midi.html#pygame.midi">pygame.midi</a> - <font size=-1>send and receive midi messages</font></li>
 <li><a href="mixer.html#pygame.mixer">pygame.mixer</a> - <font size=-1>pygame module for loading and playing sounds</font></li>
 <ul>
 <li><a href="mixer.html#pygame.mixer.Channel">pygame.mixer.Channel</a> - <font size=-1>Create a Channel object for controlling playback</font></li>
 <li><a href="mixer.html#Channel.stop">Channel.stop</a> - <font size=-1>stop playback on a Channel</font></li>
 <li><a href="mixer.html#Channel.unpause">Channel.unpause</a> - <font size=-1>resume pause playback of a channel</font></li>
 </ul>
+<li><a href="mixer.html#pygame.mixer.Sound">pygame.mixer.Sound</a> - <font size=-1>Create a new Sound object from a file</font></li>
+<ul>
+<li><a href="mixer.html#Sound.fadeout">Sound.fadeout</a> - <font size=-1>stop sound playback after fading out</font></li>
+<li><a href="mixer.html#Sound.get_buffer">Sound.get_buffer</a> - <font size=-1>acquires a buffer object for the sameples of the Sound.</font></li>
+<li><a href="mixer.html#Sound.get_length">Sound.get_length</a> - <font size=-1>get the length of the Sound</font></li>
+<li><a href="mixer.html#Sound.get_num_channels">Sound.get_num_channels</a> - <font size=-1>count how many times this Sound is playing</font></li>
+<li><a href="mixer.html#Sound.get_volume">Sound.get_volume</a> - <font size=-1>get the playback volume</font></li>
+<li><a href="mixer.html#Sound.play">Sound.play</a> - <font size=-1>begin sound playback</font></li>
+<li><a href="mixer.html#Sound.set_volume">Sound.set_volume</a> - <font size=-1>set the playback volume for this Sound</font></li>
+<li><a href="mixer.html#Sound.stop">Sound.stop</a> - <font size=-1>stop sound playback</font></li>
+</ul>
 <li><a href="mixer.html#pygame.mixer.fadeout">pygame.mixer.fadeout</a> - <font size=-1>fade out the volume on all sounds before stopping</font></li>
 <li><a href="mixer.html#pygame.mixer.find_channel">pygame.mixer.find_channel</a> - <font size=-1>find an unused channel</font></li>
 <li><a href="mixer.html#pygame.mixer.get_busy">pygame.mixer.get_busy</a> - <font size=-1>test if any sound is being mixed</font></li>
 <li><a href="mixer.html#pygame.mixer.get_init">pygame.mixer.get_init</a> - <font size=-1>test if the mixer is initialized</font></li>
 <li><a href="mixer.html#pygame.mixer.get_num_channels">pygame.mixer.get_num_channels</a> - <font size=-1>get the total number of playback channels</font></li>
 <li><a href="mixer.html#pygame.mixer.init">pygame.mixer.init</a> - <font size=-1>initialize the mixer module</font></li>
-<li><a href="mixer.html#pygame.mixer.pause">pygame.mixer.pause</a> - <font size=-1>temporarily stop playback of all sound channels</font></li>
-<li><a href="mixer.html#pygame.mixer.pre_init">pygame.mixer.pre_init</a> - <font size=-1>preset the mixer init arguments</font></li>
 <li><a href="music.html#pygame.mixer.music">pygame.mixer.music</a> - <font size=-1>pygame module for controlling streamed audio</font></li>
 <ul>
 <li><a href="music.html#pygame.mixer.music.fadeout">pygame.mixer.music.fadeout</a> - <font size=-1>stop music playback after fading out</font></li>
 <li><a href="music.html#pygame.mixer.music.stop">pygame.mixer.music.stop</a> - <font size=-1>stop the music playback</font></li>
 <li><a href="music.html#pygame.mixer.music.unpause">pygame.mixer.music.unpause</a> - <font size=-1>resume paused music</font></li>
 </ul>
+<li><a href="mixer.html#pygame.mixer.pause">pygame.mixer.pause</a> - <font size=-1>temporarily stop playback of all sound channels</font></li>
+<li><a href="mixer.html#pygame.mixer.pre_init">pygame.mixer.pre_init</a> - <font size=-1>preset the mixer init arguments</font></li>
 <li><a href="mixer.html#pygame.mixer.quit">pygame.mixer.quit</a> - <font size=-1>uninitialize the mixer</font></li>
 <li><a href="mixer.html#pygame.mixer.set_num_channels">pygame.mixer.set_num_channels</a> - <font size=-1>set the total number of playback channels</font></li>
 <li><a href="mixer.html#pygame.mixer.set_reserved">pygame.mixer.set_reserved</a> - <font size=-1>reserve channels from being automatically used</font></li>
-<li><a href="mixer.html#pygame.mixer.Sound">pygame.mixer.Sound</a> - <font size=-1>Create a new Sound object from a file</font></li>
-<ul>
-<li><a href="mixer.html#Sound.fadeout">Sound.fadeout</a> - <font size=-1>stop sound playback after fading out</font></li>
-<li><a href="mixer.html#Sound.get_buffer">Sound.get_buffer</a> - <font size=-1>acquires a buffer object for the sameples of the Sound.</font></li>
-<li><a href="mixer.html#Sound.get_length">Sound.get_length</a> - <font size=-1>get the length of the Sound</font></li>
-<li><a href="mixer.html#Sound.get_num_channels">Sound.get_num_channels</a> - <font size=-1>count how many times this Sound is playing</font></li>
-<li><a href="mixer.html#Sound.get_volume">Sound.get_volume</a> - <font size=-1>get the playback volume</font></li>
-<li><a href="mixer.html#Sound.play">Sound.play</a> - <font size=-1>begin sound playback</font></li>
-<li><a href="mixer.html#Sound.set_volume">Sound.set_volume</a> - <font size=-1>set the playback volume for this Sound</font></li>
-<li><a href="mixer.html#Sound.stop">Sound.stop</a> - <font size=-1>stop sound playback</font></li>
-</ul>
 <li><a href="mixer.html#pygame.mixer.stop">pygame.mixer.stop</a> - <font size=-1>stop playback of all sound channels</font></li>
 <li><a href="mixer.html#pygame.mixer.unpause">pygame.mixer.unpause</a> - <font size=-1>resume paused playback of sound channels</font></li>
 </ul>
 <li><a href="movie.html#Movie.stop">Movie.stop</a> - <font size=-1>stop movie playback</font></li>
 </ul>
 </ul>
-<li><a href="overlay.html#pygame.Overlay">pygame.Overlay</a> - <font size=-1>pygame object for video overlay graphics</font></li>
-<ul>
-<li><a href="overlay.html#Overlay.display">Overlay.display</a> - <font size=-1>set the overlay pixel data</font></li>
-<li><a href="overlay.html#Overlay.get_hardware">Overlay.get_hardware</a> - <font size=-1>test if the Overlay is hardware accelerated</font></li>
-<li><a href="overlay.html#Overlay.set_location">Overlay.set_location</a> - <font size=-1>control where the overlay is displayed</font></li>
-</ul>
-<li><a href="pixelarray.html#pygame.PixelArray">pygame.PixelArray</a> - <font size=-1>pygame object for direct pixel access of surfaces</font></li>
-<ul>
-<li><a href="pixelarray.html#PixelArray.compare">PixelArray.compare</a> - <font size=-1>Compares the PixelArray with another one.</font></li>
-<li><a href="pixelarray.html#PixelArray.extract">PixelArray.extract</a> - <font size=-1>Extracts the passed color from the PixelArray.</font></li>
-<li><a href="pixelarray.html#PixelArray.make_surface">PixelArray.make_surface</a> - <font size=-1>Creates a new Surface from the current PixelArray.</font></li>
-<li><a href="pixelarray.html#PixelArray.replace">PixelArray.replace</a> - <font size=-1>Replaces the passed color in the PixelArray with another one.</font></li>
-<li><a href="pixelarray.html#PixelArray.surface">PixelArray.surface</a> - <font size=-1>Gets the Surface the PixelArray uses.</font></li>
-</ul>
-<li><a href="rect.html#pygame.Rect">pygame.Rect</a> - <font size=-1>pygame object for storing rectangular coordinates</font></li>
-<ul>
-<li><a href="rect.html#Rect.clamp">Rect.clamp</a> - <font size=-1>moves the rectangle inside another</font></li>
-<li><a href="rect.html#Rect.clamp_ip">Rect.clamp_ip</a> - <font size=-1>moves the rectangle inside another, in place</font></li>
-<li><a href="rect.html#Rect.clip">Rect.clip</a> - <font size=-1>crops a rectangle inside another</font></li>
-<li><a href="rect.html#Rect.collidedict">Rect.collidedict</a> - <font size=-1>test if one rectangle in a dictionary intersects</font></li>
-<li><a href="rect.html#Rect.collidedictall">Rect.collidedictall</a> - <font size=-1>test if all rectangles in a dictionary intersect</font></li>
-<li><a href="rect.html#Rect.collidelist">Rect.collidelist</a> - <font size=-1>test if one rectangle in a list intersects</font></li>
-<li><a href="rect.html#Rect.collidelistall">Rect.collidelistall</a> - <font size=-1>test if all rectangles in a list intersect</font></li>
-<li><a href="rect.html#Rect.collidepoint">Rect.collidepoint</a> - <font size=-1>test if a point is inside a rectangle</font></li>
-<li><a href="rect.html#Rect.colliderect">Rect.colliderect</a> - <font size=-1>test if two rectangles overlap</font></li>
-<li><a href="rect.html#Rect.contains">Rect.contains</a> - <font size=-1>test if one rectangle is inside another</font></li>
-<li><a href="rect.html#Rect.copy">Rect.copy</a> - <font size=-1>copy the rectangle</font></li>
-<li><a href="rect.html#Rect.fit">Rect.fit</a> - <font size=-1>resize and move a rectangle with aspect ratio</font></li>
-<li><a href="rect.html#Rect.inflate">Rect.inflate</a> - <font size=-1>grow or shrink the rectangle size</font></li>
-<li><a href="rect.html#Rect.inflate_ip">Rect.inflate_ip</a> - <font size=-1>grow or shrink the rectangle size, in place</font></li>
-<li><a href="rect.html#Rect.move">Rect.move</a> - <font size=-1>moves the rectangle</font></li>
-<li><a href="rect.html#Rect.move_ip">Rect.move_ip</a> - <font size=-1>moves the rectangle, in place</font></li>
-<li><a href="rect.html#Rect.normalize">Rect.normalize</a> - <font size=-1>correct negative sizes</font></li>
-<li><a href="rect.html#Rect.union">Rect.union</a> - <font size=-1>joins two rectangles into one</font></li>
-<li><a href="rect.html#Rect.union_ip">Rect.union_ip</a> - <font size=-1>joins two rectangles into one, in place</font></li>
-<li><a href="rect.html#Rect.unionall">Rect.unionall</a> - <font size=-1>the union of many rectangles</font></li>
-<li><a href="rect.html#Rect.unionall_ip">Rect.unionall_ip</a> - <font size=-1>the union of many rectangles, in place</font></li>
-</ul>
+<li><a href="pygame.html#pygame.quit">pygame.quit</a> - <font size=-1>uninitialize all pygame modules</font></li>
+<li><a href="pygame.html#pygame.register_quit">pygame.register_quit</a> - <font size=-1>register a function to be called when pygame quits</font></li>
 <li><a href="scrap.html#pygame.scrap">pygame.scrap</a> - <font size=-1>pygame module for clipboard support.</font></li>
 <ul>
 <li><a href="scrap.html#pygame.scrap.contains">pygame.scrap.contains</a> - <font size=-1>Checks, whether a certain type is available in the clipboard.</font></li>
 <li><a href="scrap.html#pygame.scrap.put">pygame.scrap.put</a> - <font size=-1>Places data into the clipboard.</font></li>
 <li><a href="scrap.html#pygame.scrap.set_mode">pygame.scrap.set_mode</a> - <font size=-1>Sets the clipboard access mode.</font></li>
 </ul>
+<li><a href="pygame.html#pygame.set_error">pygame.set_error</a> - <font size=-1>set the current error message</font></li>
 <li><a href="sndarray.html#pygame.sndarray">pygame.sndarray</a> - <font size=-1>pygame module for accessing sound sample data</font></li>
 <ul>
 <li><a href="sndarray.html#pygame.sndarray.array">pygame.sndarray.array</a> - <font size=-1>copy Sound samples into an array</font></li>
 <li><a href="sprite.html#pygame.sprite">pygame.sprite</a> - <font size=-1>pygame module with basic game object classes</font></li>
 <ul>
 <li></li>
-<li><a href="sprite.html#pygame.sprite.collide_circle">pygame.sprite.collide_circle</a> - <font size=-1>collision detection between two sprites, using circles.</font></li>
-<li><a href="sprite.html#pygame.sprite.collide_circle_ratio">pygame.sprite.collide_circle_ratio</a> - <font size=-1>collision detection between two sprites, using circles scaled to a ratio.</font></li>
-<li><a href="sprite.html#pygame.sprite.collide_mask">pygame.sprite.collide_mask</a> - <font size=-1>collision detection between two sprites, using masks.</font></li>
-<li><a href="sprite.html#pygame.sprite.collide_rect">pygame.sprite.collide_rect</a> - <font size=-1>collision detection between two sprites, using rects.</font></li>
-<li><a href="sprite.html#pygame.sprite.collide_rect_ratio">pygame.sprite.collide_rect_ratio</a> - <font size=-1>collision detection between two sprites, using rects scaled to a ratio.</font></li>
 <li><a href="sprite.html#pygame.sprite.DirtySprite">pygame.sprite.DirtySprite</a> - <font size=-1>a more featureful subclass of Sprite with more attributes</font></li>
 <ul>
 <li></li>
 <li><a href="sprite.html#Group.sprites">Group.sprites</a> - <font size=-1>list of the Sprites this Group contains</font></li>
 <li><a href="sprite.html#Group.update">Group.update</a> - <font size=-1>call the update method on contained Sprites</font></li>
 </ul>
-<li><a href="sprite.html#pygame.sprite.groupcollide">pygame.sprite.groupcollide</a> - <font size=-1>find all Sprites that collide between two Groups</font></li>
 <li><a href="sprite.html#pygame.sprite.GroupSingle">pygame.sprite.GroupSingle</a> - <font size=-1>Group container that holds a single Sprite</font></li>
 <li><a href="sprite.html#pygame.sprite.LayeredDirty">pygame.sprite.LayeredDirty</a> - <font size=-1>LayeredDirty Group is for DirtySprites.  Subclasses LayeredUpdates.</font></li>
 <ul>
 <li><a href="sprite.html#Sprite.remove">Sprite.remove</a> - <font size=-1>remove the sprite from groups</font></li>
 <li><a href="sprite.html#Sprite.update">Sprite.update</a> - <font size=-1>method to control sprite behavior</font></li>
 </ul>
+<li><a href="sprite.html#pygame.sprite.collide_circle">pygame.sprite.collide_circle</a> - <font size=-1>collision detection between two sprites, using circles.</font></li>
+<li><a href="sprite.html#pygame.sprite.collide_circle_ratio">pygame.sprite.collide_circle_ratio</a> - <font size=-1>collision detection between two sprites, using circles scaled to a ratio.</font></li>
+<li><a href="sprite.html#pygame.sprite.collide_mask">pygame.sprite.collide_mask</a> - <font size=-1>collision detection between two sprites, using masks.</font></li>
+<li><a href="sprite.html#pygame.sprite.collide_rect">pygame.sprite.collide_rect</a> - <font size=-1>collision detection between two sprites, using rects.</font></li>
+<li><a href="sprite.html#pygame.sprite.collide_rect_ratio">pygame.sprite.collide_rect_ratio</a> - <font size=-1>collision detection between two sprites, using rects scaled to a ratio.</font></li>
+<li><a href="sprite.html#pygame.sprite.groupcollide">pygame.sprite.groupcollide</a> - <font size=-1>find all Sprites that collide between two Groups</font></li>
 <li><a href="sprite.html#pygame.sprite.spritecollide">pygame.sprite.spritecollide</a> - <font size=-1>find Sprites in a Group that intersect another Sprite</font></li>
 <li><a href="sprite.html#pygame.sprite.spritecollideany">pygame.sprite.spritecollideany</a> - <font size=-1>simple test if a Sprite intersects anything in a Group</font></li>
 </ul>
-<li><a href="surface.html#pygame.Surface">pygame.Surface</a> - <font size=-1>pygame object for representing images</font></li>
-<ul>
-<li><a href="surface.html#Surface.blit">Surface.blit</a> - <font size=-1>draw one image onto another</font></li>
-<li><a href="surface.html#Surface.convert">Surface.convert</a> - <font size=-1>change the pixel format of an image</font></li>
-<li><a href="surface.html#Surface.convert_alpha">Surface.convert_alpha</a> - <font size=-1>change the pixel format of an image including per pixel alphas</font></li>
-<li><a href="surface.html#Surface.copy">Surface.copy</a> - <font size=-1>create a new copy of a Surface</font></li>
-<li><a href="surface.html#Surface.fill">Surface.fill</a> - <font size=-1>fill Surface with a solid color</font></li>
-<li><a href="surface.html#Surface.get_abs_offset">Surface.get_abs_offset</a> - <font size=-1>find the absolute position of a child subsurface inside its top level parent</font></li>
-<li><a href="surface.html#Surface.get_abs_parent">Surface.get_abs_parent</a> - <font size=-1>find the top level parent of a subsurface</font></li>
-<li><a href="surface.html#Surface.get_alpha">Surface.get_alpha</a> - <font size=-1>get the current Surface transparency value</font></li>
-<li><a href="surface.html#Surface.get_at">Surface.get_at</a> - <font size=-1>get the color value at a single pixel</font></li>
-<li><a href="surface.html#Surface.get_bitsize">Surface.get_bitsize</a> - <font size=-1>get the bit depth of the Surface pixel format</font></li>
-<li><a href="surface.html#Surface.get_bounding_rect">Surface.get_bounding_rect</a> - <font size=-1>find the smallest rect containing data</font></li>
-<li><a href="surface.html#Surface.get_buffer">Surface.get_buffer</a> - <font size=-1>acquires a buffer object for the pixels of the Surface.</font></li>
-<li><a href="surface.html#Surface.get_bytesize">Surface.get_bytesize</a> - <font size=-1>get the bytes used per Surface pixel</font></li>
-<li><a href="surface.html#Surface.get_clip">Surface.get_clip</a> - <font size=-1>get the current clipping area of the Surface</font></li>
-<li><a href="surface.html#Surface.get_colorkey">Surface.get_colorkey</a> - <font size=-1>Get the current transparent colorkey</font></li>
-<li><a href="surface.html#Surface.get_flags">Surface.get_flags</a> - <font size=-1>get the additional flags used for the Surface</font></li>
-<li><a href="surface.html#Surface.get_height">Surface.get_height</a> - <font size=-1>get the height of the Surface</font></li>
-<li><a href="surface.html#Surface.get_locked">Surface.get_locked</a> - <font size=-1>test if the Surface is current locked</font></li>
-<li><a href="surface.html#Surface.get_locks">Surface.get_locks</a> - <font size=-1>Gets the locks for the Surface</font></li>
-<li><a href="surface.html#Surface.get_losses">Surface.get_losses</a> - <font size=-1>the significant bits used to convert between a color and a mapped integer</font></li>
-<li><a href="surface.html#Surface.get_masks">Surface.get_masks</a> - <font size=-1>the bitmasks needed to convert between a color and a mapped integer</font></li>
-<li><a href="surface.html#Surface.get_offset">Surface.get_offset</a> - <font size=-1>find the position of a child subsurface inside a parent</font></li>
-<li><a href="surface.html#Surface.get_palette">Surface.get_palette</a> - <font size=-1>get the color index palette for an 8bit Surface</font></li>
-<li><a href="surface.html#Surface.get_palette_at">Surface.get_palette_at</a> - <font size=-1>get the color for a single entry in a palette</font></li>
-<li><a href="surface.html#Surface.get_parent">Surface.get_parent</a> - <font size=-1>find the parent of a subsurface</font></li>
-<li><a href="surface.html#Surface.get_pitch">Surface.get_pitch</a> - <font size=-1>get the number of bytes used per Surface row</font></li>
-<li><a href="surface.html#Surface.get_rect">Surface.get_rect</a> - <font size=-1>get the rectangular area of the Surface</font></li>
-<li><a href="surface.html#Surface.get_shifts">Surface.get_shifts</a> - <font size=-1>the bit shifts needed to convert between a color and a mapped integer</font></li>
-<li><a href="surface.html#Surface.get_size">Surface.get_size</a> - <font size=-1>get the dimensions of the Surface</font></li>
-<li><a href="surface.html#Surface.get_width">Surface.get_width</a> - <font size=-1>get the width of the Surface</font></li>
-<li><a href="surface.html#Surface.lock">Surface.lock</a> - <font size=-1>lock the Surface memory for pixel access</font></li>
-<li><a href="surface.html#Surface.map_rgb">Surface.map_rgb</a> - <font size=-1>convert a color into a mapped color value</font></li>
-<li><a href="surface.html#Surface.mustlock">Surface.mustlock</a> - <font size=-1>test if the Surface requires locking</font></li>
-<li><a href="surface.html#Surface.scroll">Surface.scroll</a> - <font size=-1>Shift the surface image in place</font></li>
-<li><a href="surface.html#Surface.set_alpha">Surface.set_alpha</a> - <font size=-1>set the alpha value for the full Surface image</font></li>
-<li><a href="surface.html#Surface.set_at">Surface.set_at</a> - <font size=-1>set the color value for a single pixel</font></li>
-<li><a href="surface.html#Surface.set_clip">Surface.set_clip</a> - <font size=-1>set the current clipping area of the Surface</font></li>
-<li><a href="surface.html#Surface.set_colorkey">Surface.set_colorkey</a> - <font size=-1>Set the transparent colorkey</font></li>
-<li><a href="surface.html#Surface.set_masks">Surface.set_masks</a> - <font size=-1>set the bitmasks needed to convert between a color and a mapped integer</font></li>
-<li><a href="surface.html#Surface.set_palette">Surface.set_palette</a> - <font size=-1>set the color palette for an 8bit Surface</font></li>
-<li><a href="surface.html#Surface.set_palette_at">Surface.set_palette_at</a> - <font size=-1>set the color for a single index in an 8bit Surface palette</font></li>
-<li><a href="surface.html#Surface.set_shifts">Surface.set_shifts</a> - <font size=-1>sets the bit shifts needed to convert between a color and a mapped integer</font></li>
-<li><a href="surface.html#Surface.subsurface">Surface.subsurface</a> - <font size=-1>create a new surface that references its parent</font></li>
-<li><a href="surface.html#Surface.unlock">Surface.unlock</a> - <font size=-1>unlock the Surface memory from pixel access</font></li>
-<li><a href="surface.html#Surface.unmap_rgb">Surface.unmap_rgb</a> - <font size=-1>convert a mapped integer color value into a Color</font></li>
-</ul>
 <li><a href="surfarray.html#pygame.surfarray">pygame.surfarray</a> - <font size=-1>pygame module for accessing surface pixel data using array interfaces</font></li>
 <ul>
 <li><a href="surfarray.html#pygame.surfarray.array2d">pygame.surfarray.array2d</a> - <font size=-1>Copy pixels into a 2d array</font></li>
 <li><a href="transform.html#pygame.transform.smoothscale">pygame.transform.smoothscale</a> - <font size=-1>scale a surface to an arbitrary size smoothly</font></li>
 <li><a href="transform.html#pygame.transform.threshold">pygame.transform.threshold</a> - <font size=-1>finds which, and how many pixels in a surface are within a threshold of a color.</font></li>
 </ul>
-<li><a href="pygame.html#pygame.quit">pygame.quit</a> - <font size=-1>uninitialize all pygame modules</font></li>
-<li><a href="pygame.html#pygame.register_quit">pygame.register_quit</a> - <font size=-1>register a function to be called when pygame quits</font></li>
 <li><a href="pygame.html#pygame.version">pygame.version</a> - <font size=-1>small module containing version information</font></li>
 <ul>
 <li><a href="pygame.html#pygame.version.ver">pygame.version.ver</a> - <font size=-1>version number as a string</font></li>

docs/ref/joystick.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/key.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/locals.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/mask.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/midi.html

+
+<html>
+<title>midi - Pygame Documentation</title>
+<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
+
+
+<table cellpadding=0 cellspacing=0 border=0 style='border: 3px solid black;' width='100%'>
+<tr>
+<td bgcolor='#c2fc20' style='padding: 6px;' align=center valign=center><a href='http://www.pygame.org/'><img src='../pygame_tiny.gif' border=0 width=200 height=60></a><br><b>pygame documentation</b></td>
+<td bgcolor='#6aee28' style='border-left: 3px solid black; padding: 6px;' align=center valign=center>
+	||&nbsp;
+	<a href=http://www.pygame.org>Pygame Home</a> &nbsp;||&nbsp;
+	<a href=../index.html>Help Contents</a> &nbsp;||
+	<a href=index.html>Reference Index</a> &nbsp;||
+	<br>&nbsp;<br>
+	
+<a href="camera.html">Camera</a>&nbsp;||&nbsp;
+<a href="cdrom.html">Cdrom</a>&nbsp;||&nbsp;
+<a href="color.html">Color</a>&nbsp;||&nbsp;
+<a href="cursors.html">Cursors</a>&nbsp;||&nbsp;
+<a href="display.html">Display</a>&nbsp;||&nbsp;
+<a href="draw.html">Draw</a>&nbsp;||&nbsp;
+<a href="event.html">Event</a>&nbsp;||&nbsp;
+<a href="examples.html">Examples</a>&nbsp;||&nbsp;
+<a href="font.html">Font</a>&nbsp;||&nbsp;
+<a href="image.html">Image</a>&nbsp;||&nbsp;
+<a href="joystick.html">Joystick</a>&nbsp;||&nbsp;
+<a href="key.html">Key</a>&nbsp;||&nbsp;
+<a href="locals.html">Locals</a>&nbsp;||&nbsp;
+<a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
+<a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
+<a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
+<a href="movie.html">Movie</a>&nbsp;||&nbsp;
+<a href="music.html">Music</a>&nbsp;||&nbsp;
+<a href="overlay.html">Overlay</a>&nbsp;||&nbsp;
+<a href="pixelarray.html">Pixelarray</a>&nbsp;||&nbsp;
+<a href="pygame.html">Pygame</a>&nbsp;||&nbsp;
+<a href="rect.html">Rect</a>&nbsp;||&nbsp;
+<a href="scrap.html">Scrap</a>&nbsp;||&nbsp;
+<a href="sndarray.html">Sndarray</a>&nbsp;||&nbsp;
+<a href="sprite.html">Sprite</a>&nbsp;||&nbsp;
+<a href="surface.html">Surface</a>&nbsp;||&nbsp;
+<a href="surfarray.html">Surfarray</a>&nbsp;||&nbsp;
+<a href="tests.html">Tests</a>&nbsp;||&nbsp;
+<a href="time.html">Time</a>&nbsp;||&nbsp;
+<a href="transform.html">Transform</a>
+</td></tr></table>
+<br>
+
+
+<a name="pygame.midi">
+<big><b>pygame.midi</big></b><br><ul>
+  <i>send and receive midi messages</i><br>
+<p>=== Under Development === </p>
+<p>See <tt>examples\midi.py</tt> for the current status the midi module api. </p>
+<!--COMMENTS:pygame.midi--> &nbsp;<br> 
+<br></ul>
+
+</body></html>

docs/ref/mixer.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/mouse.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/movie.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/music.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/overlay.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/pixelarray.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/pygame.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;
   <tr><td><a href="pygame.html#pygame.quit">pygame.quit</a> - <font size=-1>uninitialize all pygame modules</font></td><td>uninitialize all pygame modules</td></tr>
   <tr><td><a href="pygame.html#pygame.error">pygame.error</a> - <font size=-1>standard pygame exception</font></td><td>standard pygame exception</td></tr>
   <tr><td><a href="pygame.html#pygame.get_error">pygame.get_error</a> - <font size=-1>get the current error message</font></td><td>get the current error message</td></tr>
+  <tr><td><a href="pygame.html#pygame.set_error">pygame.set_error</a> - <font size=-1>set the current error message</font></td><td>set the current error message</td></tr>
   <tr><td><a href="pygame.html#pygame.get_sdl_version">pygame.get_sdl_version</a> - <font size=-1>get the version number of SDL</font></td><td>get the version number of SDL</td></tr>
   <tr><td><a href="pygame.html#pygame.get_sdl_byteorder">pygame.get_sdl_byteorder</a> - <font size=-1>get the byte order of SDL</font></td><td>get the byte order of SDL</td></tr>
   <tr><td><a href="pygame.html#pygame.register_quit">pygame.register_quit</a> - <font size=-1>register a function to be called when pygame quits</font></td><td>register a function to be called when pygame quits</td></tr>
 <br></ul>
 
 
+<a name="pygame.set_error">
+<big><b>pygame.set_error</big></b><br><ul>
+  <i>set the current error message</i><br>
+  <tt>pygame.set_error(error_msg): return None</tt><br>
+<p><tt>SDL</tt> maintains an internal error message. This message will usually be given to you when <tt>pygame.error</tt> is raised. You will rarely need to call this function. </p>
+<!--COMMENTS:pygame.set_error--> &nbsp;<br> 
+<br></ul>
+
+
 <a name="pygame.get_sdl_version">
 <big><b>pygame.get_sdl_version</big></b><br><ul>
   <i>get the version number of SDL</i><br>

docs/ref/rect.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/scrap.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/sndarray.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/sprite.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/surface.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/surfarray.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/tests.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/time.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

docs/ref/transform.html

 <a href="key.html">Key</a>&nbsp;||&nbsp;
 <a href="locals.html">Locals</a>&nbsp;||&nbsp;
 <a href="mask.html">Mask</a>&nbsp;||&nbsp;
+<a href="midi.html">Midi</a>&nbsp;||&nbsp;
 <a href="mixer.html">Mixer</a>&nbsp;||&nbsp;
 <a href="mouse.html">Mouse</a>&nbsp;||&nbsp;
 <a href="movie.html">Movie</a>&nbsp;||&nbsp;

examples/aacircle.py

             event = pygame.event.wait()
             if event.type == pygame.QUIT:
                 break
+            if event.type == pygame.KEYDOWN:
+                if event.key == pygame.K_ESCAPE or event.unicode == 'q':
+                    break
             pygame.display.flip()
     finally:
         pygame.quit()

examples/aliens.py

 
 #see if we can load more than standard BMP
 if not pygame.image.get_extended():
-    raise SystemExit, "Sorry, extended image module required"
+    raise SystemExit("Sorry, extended image module required")
 
 
 #game constants
     try:
         surface = pygame.image.load(file)
     except pygame.error:
-        raise SystemExit, 'Could not load image "%s" %s'%(file, pygame.get_error())
+        raise SystemExit('Could not load image "%s" %s'%(file, pygame.get_error()))
     return surface.convert()
 
 def load_images(*files):
         sound = pygame.mixer.Sound(file)
         return sound
     except pygame.error:
-        print 'Warning, unable to load,', file
+        print ('Warning, unable to load, %s' % file)
     return dummysound()
 
 
             self.image = self.images[0]
         elif direction > 0:
             self.image = self.images[1]
-        self.rect.top = self.origtop - (self.rect.left/self.bounce%2)
+        self.rect.top = self.origtop - (self.rect.left//self.bounce%2)
 
     def gunpos(self):
         pos = self.facing*self.gun_offset + self.rect.centerx
             self.rect.top = self.rect.bottom + 1
             self.rect = self.rect.clamp(SCREENRECT)
         self.frame = self.frame + 1
-        self.image = self.images[self.frame/self.animcycle%3]
+        self.image = self.images[self.frame//self.animcycle%3]
 
 
 class Explosion(pygame.sprite.Sprite):
 
     def update(self):
         self.life = self.life - 1
-        self.image = self.images[self.life/self.animcycle%2]
+        self.image = self.images[self.life//self.animcycle%2]
         if self.life <= 0: self.kill()
 
 
     # Initialize pygame
     pygame.init()
     if pygame.mixer and not pygame.mixer.get_init():
-        print 'Warning, no sound'
+        print ('Warning, no sound')
         pygame.mixer = None
 
     # Set the display mode

examples/chimp.py

 #Import Modules
 import os, pygame
 from pygame.locals import *
+from pygame.compat import geterror
 
-if not pygame.font: print 'Warning, fonts disabled'
-if not pygame.mixer: print 'Warning, sound disabled'
+if not pygame.font: print ('Warning, fonts disabled')
+if not pygame.mixer: print ('Warning, sound disabled')
 
 main_dir = os.path.split(os.path.abspath(__file__))[0]
 data_dir = os.path.join(main_dir, 'data')
     fullname = os.path.join(data_dir, name)
     try:
         image = pygame.image.load(fullname)
-    except pygame.error, message:
-        print 'Cannot load image:', fullname
-        raise SystemExit, message
+    except pygame.error:
+        print ('Cannot load image:', fullname)
+        raise SystemExit(str(geterror()))
     image = image.convert()
     if colorkey is not None:
         if colorkey is -1:
     fullname = os.path.join(data_dir, name)
     try:
         sound = pygame.mixer.Sound(fullname)
-    except pygame.error, message:
-        print 'Cannot load sound:', fullname
-        raise SystemExit, message
+    except pygame.error:
+        print ('Cannot load sound: %s' % fullname)
+        raise SystemExit(str(geterror()))
     return sound
 
 

examples/fonty.py

 
 import pygame
 from pygame.locals import *
+from pygame.compat import unichr_, unicode_
+import sys
+import locale
 
 
+if sys.version_info >= (3,):
+    def print_unicode(s):
+        e = locale.getpreferredencoding()
+        print (s.encode(e, 'backslashreplace').decode())
+else:
+    def print_unicode(s):
+        e = locale.getpreferredencoding()
+        print (s.encode(e, 'backslashreplace'))
+
 def main():
     #initialize
     pygame.init()
     resolution = 400, 200
     screen = pygame.display.set_mode(resolution)
 
-    #the python 1.5.2 way to set the cursor
-    apply(pygame.mouse.set_cursor, pygame.cursors.diamond)
-    #the python 2.0 way to set the cursor
-    #pygame.mouse.set_cursor(*pygame.cursors.diamond)
+##    pygame.mouse.set_cursor(*pygame.cursors.diamond)
 
     fg = 250, 240, 230
     bg = 5, 5, 5
 
 
     # Get some metrics.
-    print "Font metrics for 'Fonty': ", a_sys_font.metrics (text)
-    print u"Font metrics for '\u3060': ".encode("utf-8"), \
-          a_sys_font.metrics (u"\u3060")
+    print ("Font metrics for 'Fonty':  %s" % a_sys_font.metrics (text))
+    ch = unicode_("%c") % 0x3060
+    msg = (unicode_("Font metrics for '%s':  %s") %
+           (ch, a_sys_font.metrics (ch)))
+    print_unicode(msg)
 
-
-    ##some_japanese_unicode = u"\u304b\u3070\u306b"
+    ## #some_japanese_unicode = u"\u304b\u3070\u306b"
+    ##some_japanese_unicode = unicode_('%c%c%c') % (0x304b, 0x3070, 0x306b)
     
     #AA, transparancy, italic
     ##ren = a_sys_font.render(some_japanese_unicode, 1, fg)

examples/scaletest.py

 
 
 def SpeedTest(image):
-    print "Smoothscale Speed Test - Image Size %s\n" % str(image.get_size())
+    print ("Smoothscale Speed Test - Image Size %s\n" % str(image.get_size()))
     imgsize = [image.get_width(), image.get_height()]
     duration = 0.0
     for i in range(128):
         tempimg = pygame.transform.smoothscale(image, (shrinkx, shrinky))
         duration += (time.time() - start)
         del tempimg
-    print "Average smooth shrink time: %i milliseconds." % int((duration / 128) * 1000)
+    print ("Average smooth shrink time: %i milliseconds." % int((duration / 128) * 1000))
     duration = 0
     for i in range(128):
         expandx = (imgsize[0] * (i + 129)) / 128
         tempimg = pygame.transform.smoothscale(image, (expandx, expandy))
         duration += (time.time() - start)
         del tempimg
-    print "Average smooth expand time: %i milliseconds." % int((duration / 128) * 1000)
+    print ("Average smooth expand time: %i milliseconds." % int((duration / 128) * 1000))
     duration = 0.0
     for i in range(128):
         shrinkx = (imgsize[0] * i) / 128
         tempimg = pygame.transform.scale(image, (shrinkx, shrinky))
         duration += (time.time() - start)
         del tempimg
-    print "Average jaggy shrink time: %i milliseconds." % int((duration / 128) * 1000)
+    print ("Average jaggy shrink time: %i milliseconds." % int((duration / 128) * 1000))
     duration = 0
     for i in range(128):
         expandx = (imgsize[0] * (i + 129)) / 128
         tempimg = pygame.transform.scale(image, (expandx, expandy))
         duration += (time.time() - start)
         del tempimg
-    print "Average jaggy expand time: %i milliseconds." % int((duration / 128) * 1000)
+    print ("Average jaggy expand time: %i milliseconds." % int((duration / 128) * 1000))
 
 
 
 if __name__ == '__main__':
     # check input parameters
     if len(sys.argv) < 2:
-        print"Usage: %s ImageFile [-t] [-convert_alpha]" % sys.argv[0]
-        print"       [-t] = Run Speed Test\n"
-        print"       [-convert_alpha] = Use convert_alpha() on the surf.\n"
+        print ("Usage: %s ImageFile [-t] [-convert_alpha]" % sys.argv[0])
+        print ("       [-t] = Run Speed Test\n")
+        print ("       [-convert_alpha] = Use convert_alpha() on the surf.\n")
     else:
         main(sys.argv[1],
              convert_alpha = '-convert_alpha' in sys.argv,

examples/stars.py

 
 
 def init_star():
-	"creates new star values"
-	dir = random.randrange(100000)
-	velmult = random.random()*.6+.4
-	vel = [math.sin(dir) * velmult, math.cos(dir) * velmult]
-	return vel, WINCENTER[:]
+    "creates new star values"
+    dir = random.randrange(100000)
+    velmult = random.random()*.6+.4
+    vel = [math.sin(dir) * velmult, math.cos(dir) * velmult]
+    return vel, WINCENTER[:]
 
 
 def initialize_stars():
-	"creates a new starfield"
-	stars = []
-	for x in range(NUMSTARS):
-		star = init_star()
-		vel, pos = star
-		steps = random.randint(0, WINCENTER[0])
-		pos[0] = pos[0] + (vel[0] * steps)
-		pos[1] = pos[1] + (vel[1] * steps)
-		vel[0] = vel[0] * (steps * .09)
-		vel[1] = vel[1] * (steps * .09)
-		stars.append(star)
-	move_stars(stars)
-	return stars
-	
+    "creates a new starfield"
+    stars = []
+    for x in range(NUMSTARS):
+        star = init_star()
+        vel, pos = star
+        steps = random.randint(0, WINCENTER[0])
+        pos[0] = pos[0] + (vel[0] * steps)
+        pos[1] = pos[1] + (vel[1] * steps)
+        vel[0] = vel[0] * (steps * .09)
+        vel[1] = vel[1] * (steps * .09)
+        stars.append(star)
+    move_stars(stars)
+    return stars
+  
 
 def draw_stars(surface, stars, color):
-	"used to draw (and clear) the stars"
-	for vel, pos in stars:
-                pos = (int(pos[0]), int(pos[1]))
-		surface.set_at(pos, color)
+    "used to draw (and clear) the stars"
+    for vel, pos in stars:
+        pos = (int(pos[0]), int(pos[1]))
+        surface.set_at(pos, color)
 
 
 def move_stars(stars):
-	"animate the star values"
-	for vel, pos in stars:
-		pos[0] = pos[0] + vel[0]
-		pos[1] = pos[1] + vel[1]
-		if not 0 <= pos[0] <= WINSIZE[0] or not 0 <= pos[1] <= WINSIZE[1]:
-			vel[:], pos[:] = init_star()
-		else:
-			vel[0] = vel[0] * 1.05
-			vel[1] = vel[1] * 1.05
-	
+    "animate the star values"
+    for vel, pos in stars:
+        pos[0] = pos[0] + vel[0]
+        pos[1] = pos[1] + vel[1]
+        if not 0 <= pos[0] <= WINSIZE[0] or not 0 <= pos[1] <= WINSIZE[1]:
+            vel[:], pos[:] = init_star()
+        else:
+            vel[0] = vel[0] * 1.05
+            vel[1] = vel[1] * 1.05
+  
 
 def main():
-	"This is the starfield code"
-	#create our starfield
-	random.seed()
-	stars = initialize_stars()
-        clock = pygame.time.Clock()
-	#initialize and prepare screen
-	pygame.init()
-	screen = pygame.display.set_mode(WINSIZE)
-	pygame.display.set_caption('pygame Stars Example')
-	white = 255, 240, 200
-	black = 20, 20, 40
-	screen.fill(black)
+    "This is the starfield code"
+    #create our starfield
+    random.seed()
+    stars = initialize_stars()
+    clock = pygame.time.Clock()
+    #initialize and prepare screen
+    pygame.init()
+    screen = pygame.display.set_mode(WINSIZE)
+    pygame.display.set_caption('pygame Stars Example')
+    white = 255, 240, 200
+    black = 20, 20, 40
+    screen.fill(black)
 
-	#main game loop
-	done = 0
-	while not done:
-		draw_stars(screen, stars, black)
-		move_stars(stars)
-		draw_stars(screen, stars, white)
-		pygame.display.update()
-		for e in pygame.event.get():
-			if e.type == QUIT or (e.type == KEYUP and e.key == K_ESCAPE):
-				done = 1
-				break
-			elif e.type == MOUSEBUTTONDOWN and e.button == 1:
-				WINCENTER[:] = list(e.pos)
-                clock.tick(50)
+    #main game loop
+    done = 0
+    while not done:
+        draw_stars(screen, stars, black)
+        move_stars(stars)
+        draw_stars(screen, stars, white)
+        pygame.display.update()
+        for e in pygame.event.get():
+            if e.type == QUIT or (e.type == KEYUP and e.key == K_ESCAPE):
+                done = 1
+                break
+            elif e.type == MOUSEBUTTONDOWN and e.button == 1:
+                WINCENTER[:] = list(e.pos)
+        clock.tick(50)
 
 
 # if python says run, then we should run
 if __name__ == '__main__':
-	main()
+    main()
 
 
 
 # check if is old windows... if so use directx video driver by default.
 # if someone sets this respect their setting...
-if not os.environ.get('SDL_VIDEODRIVER', ''):
+if not 'SDL_VIDEODRIVER' in os.environ:
     # http://docs.python.org/lib/module-sys.html
     # 0 (VER_PLATFORM_WIN32s) 	Win32s on Windows 3.1
     # 1 (VER_PLATFORM_WIN32_WINDOWS) 	Windows 95/98/ME
         MissingPygameModule = "%s module not available" % self.name
         if self.reason:
             MissingPygameModule += "\n(%s)" % self.reason
-        raise NotImplementedError, MissingPygameModule
+        raise NotImplementedError(MissingPygameModule)
 
     def __nonzero__(self):
         return 0
             else: level = 3
             warnings.warn(message, RuntimeWarning, level)
         except ImportError:
-            print message
+            print (message)
 
 
 
 from pygame.constants import *
 from pygame.version import *
 from pygame.rect import Rect
+from pygame.compat import geterror
 import pygame.rwobject
 import pygame.surflock
 import pygame.color
 #next, the "standard" modules
 #we still allow them to be missing for stripped down pygame distributions
 try: import pygame.cdrom
-except (ImportError,IOError), msg:cdrom=MissingModule("cdrom", msg, 1)
+except (ImportError,IOError):cdrom=MissingModule("cdrom", geterror(), 1)
 
 try: import pygame.cursors
-except (ImportError,IOError), msg:cursors=MissingModule("cursors", msg, 1)
+except (ImportError,IOError):cursors=MissingModule("cursors", geterror(), 1)
 
 try: import pygame.display
-except (ImportError,IOError), msg:display=MissingModule("display", msg, 1)
+except (ImportError,IOError):display=MissingModule("display", geterror(), 1)
 
 try: import pygame.draw
-except (ImportError,IOError), msg:draw=MissingModule("draw", msg, 1)
+except (ImportError,IOError):draw=MissingModule("draw", geterror(), 1)
 
 try: import pygame.event
-except (ImportError,IOError), msg:event=MissingModule("event", msg, 1)
+except (ImportError,IOError):event=MissingModule("event", geterror(), 1)
 
 try: import pygame.image
-except (ImportError,IOError), msg:image=MissingModule("image", msg, 1)
+except (ImportError,IOError):image=MissingModule("image", geterror(), 1)
 
 try: import pygame.joystick
-except (ImportError,IOError), msg:joystick=MissingModule("joystick", msg, 1)
+except (ImportError,IOError):joystick=MissingModule("joystick", geterror(), 1)
 
 try: import pygame.key
-except (ImportError,IOError), msg:key=MissingModule("key", msg, 1)
+except (ImportError,IOError):key=MissingModule("key", geterror(), 1)
 
 try: import pygame.mouse
-except (ImportError,IOError), msg:mouse=MissingModule("mouse", msg, 1)
+except (ImportError,IOError):mouse=MissingModule("mouse", geterror(), 1)
 
 try: import pygame.sprite
-except (ImportError,IOError), msg:sprite=MissingModule("sprite", msg, 1)
+except (ImportError,IOError):sprite=MissingModule("sprite", geterror(), 1)
 
 
 try: import pygame.threads
-except (ImportError,IOError), msg:threads=MissingModule("threads", msg, 1)
+except (ImportError,IOError):threads=MissingModule("threads", geterror(), 1)
 
 
 def warn_unwanted_files():
 
 
     # See if any of the files are there.
-    extension_files = map(lambda x:"%s%s" % (x,extension_ext), ext_to_remove)
+    extension_files = ["%s%s" % (x, extension_ext) for x in ext_to_remove]
 
-    py_files = []
-    for py_ext in [".py", ".pyc", ".pyo"]:
-        py_files.extend( map(lambda x:"%s%s" % (x,py_ext), py_to_remove) )
-    
+    py_files = ["%s%s" % (x, py_ext)
+                for py_ext in [".py", ".pyc", ".pyo"]
+                for x in py_to_remove]
 
     files = py_files + extension_files
 
             level = 4
             warnings.warn(message, RuntimeWarning, level)
         except ImportError:
-            print message
+            print (message)
         
 warn_unwanted_files()
 
 except (ImportError,IOError):Overlay = lambda:Missing_Function
 
 try: import pygame.time
-except (ImportError,IOError), msg:time=MissingModule("time", msg, 1)
+except (ImportError,IOError):time=MissingModule("time", geterror(), 1)
 
 try: import pygame.transform
-except (ImportError,IOError), msg:transform=MissingModule("transform", msg, 1)
+except (ImportError,IOError):transform=MissingModule("transform", geterror(), 1)
 
 #lastly, the "optional" pygame modules
 try:
     pygame.font.SysFont = pygame.sysfont.SysFont
     pygame.font.get_fonts = pygame.sysfont.get_fonts
     pygame.font.match_font = pygame.sysfont.match_font
-except (ImportError,IOError), msg:font=MissingModule("font", msg, 0)
+except (ImportError,IOError):font=MissingModule("font", geterror(), 0)
 
 # try and load pygame.mixer_music before mixer, for py2app...
 try:
     import pygame.mixer_music
     #del pygame.mixer_music
-    #print "NOTE2: failed importing pygame.mixer_music in lib/__init__.py"
+    #print ("NOTE2: failed importing pygame.mixer_music in lib/__init__.py")
 except (ImportError,IOError):
     pass
 
 try: import pygame.mixer
-except (ImportError,IOError), msg:mixer=MissingModule("mixer", msg, 0)
+except (ImportError,IOError):mixer=MissingModule("mixer", geterror(), 0)
 
 try: import pygame.movie
-except (ImportError,IOError), msg:movie=MissingModule("movie", msg, 0)
+except (ImportError,IOError):movie=MissingModule("movie", geterror(), 0)
 
 #try: import pygame.movieext
-#except (ImportError,IOError), msg:movieext=MissingModule("movieext", msg, 0)
+#except (ImportError,IOError):movieext=MissingModule("movieext", geterror(), 0)
 
 try: import pygame.scrap
-except (ImportError,IOError), msg:scrap=MissingModule("scrap", msg, 0)
+except (ImportError,IOError):scrap=MissingModule("scrap", geterror(), 0)
 
 try: import pygame.surfarray
-except (ImportError,IOError), msg:surfarray=MissingModule("surfarray", msg, 0)
+except (ImportError,IOError):surfarray=MissingModule("surfarray", geterror(), 0)
 
 try: import pygame.sndarray
-except (ImportError,IOError), msg:sndarray=MissingModule("sndarray", msg, 0)
+except (ImportError,IOError):sndarray=MissingModule("sndarray", geterror(), 0)
 
 try: import pygame.fastevent
-except (ImportError,IOError), msg:fastevent=MissingModule("fastevent", msg, 0)
+except (ImportError,IOError):fastevent=MissingModule("fastevent", geterror(), 0)
 
 #there's also a couple "internal" modules not needed
 #by users, but putting them here helps "dependency finder"
     import pygame.colordict
 
 #make Rects pickleable
-import copy_reg
+try:
+    import copy_reg
+except ImportError:
+    import copyreg as copy_reg
 def __rect_constructor(x,y,w,h):
 	return Rect(x,y,w,h)
 def __rect_reduce(r):
 copy_reg.pickle(Rect, __rect_reduce, __rect_constructor)
 
 #cleanup namespace
-del pygame, os, sys, rwobject, surflock, MissingModule, copy_reg
+del pygame, os, sys, rwobject, surflock, MissingModule, copy_reg, geterror
+"""Python 2.x/3.x compatibility tools"""
+
+import sys
+
+__all__ = ['geterror']
+
+def geterror ():
+    return sys.exc_info()[1]
+
+try:
+    long_ = long
+except NameError:
+    long_ = int
+
+try:
+    xrange_ = xrange
+except NameError:
+    xrange_ = range
+
+def get_BytesIO():
+    try:
+        from cStringIO import StringIO as BytesIO
+    except ImportError:
+        from io import BytesIO
+    return BytesIO
+
+def ord_(o):
+    try:
+        return ord(o)
+    except TypeError:
+        return o
+
+try:
+    unichr_ = unichr
+except NameError:
+    unichr_ = chr
+
+try:
+    unicode_ = unicode
+except NameError:
+    unicode_ = str
         rep = NSBitmapImageRep.alloc().initWithData_(data)
         if rep is None:
             return None
-        data = rep.representationUsingType_properties_(NSBMPFileType, None)
+
+        # bug with bmp, out of memory error... so we use png.
+        #data = rep.representationUsingType_properties_(NSBMPFileType, None)
+        data = rep.representationUsingType_properties_(NSPNGFileType, None)
         bmp = StringIO(data)
-        return pygame.image.load(bmp, "scrap.bmp")
+        return pygame.image.load(bmp, "scrap.png")
     #elif scrap_type in board.types:
     elif scrap_type == SCRAP_BMP:
         return board.dataForType_(scrap_type)
+pygame.midi
+send and receive midi messages
+
+=== Under Development ===
+
+See examples\midi.py for the current status the midi module api.
+<END>
 __all__ = ['getResource']
 import sys
 import os
-from cStringIO import StringIO
+from pygame.compat import get_BytesIO
+BytesIO = get_BytesIO()
 
 try:
     from pkg_resources import resource_stream, resource_exists
     mod = sys.modules[pkgname]
     fn = getattr(mod, '__file__', None)
     if fn is None:
-        raise IOError, "%r has no __file__!"
+        raise IOError("%s has no __file__!" % repr(mod))
     path = os.path.join(os.path.dirname(fn), identifier)
     loader = getattr(mod, '__loader__', None)
     if loader is not None:
         except IOError:
             pass
         else:
-            return StringIO(data)
-    return file(os.path.normpath(path), 'rb')
+            return BytesIO(data)
+    return open(os.path.normpath(path), 'rb')
         Any number of Group instances can be passed as arguments. The 
         Sprite will be added to the Groups it is not already a member of.
         """
-        has = self.__g.has_key
+        has = self.__g.__contains__
         for group in groups:
             if hasattr(group, '_spritegroup'):
                 if not has(group):
         Any number of Group instances can be passed as arguments. The Sprite will
         be removed from the Groups it is currently a member of.
         """
-        has = self.__g.has_key
+        has = self.__g.__contains__
         for group in groups:
             if hasattr(group, '_spritegroup'):
                 if has(group):
            (For now it is always a list, but newer version of Python
            could return different iterators.) You can also iterate directly