├── examples ├── __init__.py ├── data │ ├── blue.mpg │ ├── bomb.gif │ ├── boom.wav │ ├── brick.png │ ├── chimp.bmp │ ├── city.png │ ├── fist.bmp │ ├── punch.wav │ ├── sans.ttf │ ├── shot.gif │ ├── whiff.wav │ ├── yuv_1.pgm │ ├── alien1.gif │ ├── alien1.jpg │ ├── alien1.png │ ├── alien2.gif │ ├── alien2.png │ ├── alien3.gif │ ├── alien3.png │ ├── asprite.bmp │ ├── danger.gif │ ├── liquid.bmp │ ├── player1.gif │ ├── static.png │ ├── arraydemo.bmp │ ├── background.gif │ ├── car_door.wav │ ├── explosion1.gif │ ├── house_lo.mp3 │ ├── house_lo.ogg │ ├── house_lo.wav │ ├── midikeys.png │ ├── oldplayer.gif │ └── secosmic_lo.wav ├── macosx │ └── aliens_app_example │ │ ├── English.lproj │ │ ├── aliens.icns │ │ └── MainMenu.nib │ │ │ ├── keyedobjects.nib │ │ │ ├── JavaCompiling.plist │ │ │ ├── classes.nib │ │ │ └── info.nib │ │ ├── README.txt │ │ └── setup.py ├── aacircle.py ├── headless_no_windows_needed.py ├── sound.py └── overlay.py ├── .gdbinit ├── configtest ├── testdir │ ├── bin │ │ ├── SDL.dll │ │ ├── jpeg.dll │ │ ├── smpeg.dll │ │ ├── zlib1.dll │ │ ├── SDL_image.dll │ │ ├── SDL_ttf.dll │ │ ├── libogg-0.dll │ │ ├── libpng12-0.dll │ │ ├── libtiff.dll │ │ ├── libfreetype-6.dll │ │ ├── libvorbis-0.dll │ │ └── libvorbisfile-3.dll │ ├── lib │ │ ├── SDL_mixer.dll │ │ ├── libjpeg.dll.a │ │ ├── libpng12.dll.a │ │ ├── libSDL_image.dll.a │ │ ├── libSDL_mixer.dll.a │ │ └── libSDL_ttf.dll.a │ ├── smpeg │ │ └── Release │ │ │ └── smpeg.dll │ ├── jpeg-6b │ │ └── Release │ │ │ └── jpeg.dll │ ├── zlib-1.2.3 │ │ └── Release │ │ │ └── zlib1.dll │ ├── SDL_ttf-2.0.9 │ │ └── Release │ │ │ └── SDL_ttf.dll │ ├── libogg-1.1.3 │ │ └── Release │ │ │ └── libogg-0.dll │ ├── libpng-1.2.32 │ │ └── lib │ │ │ └── libpng13.dll │ ├── tiff-3.8.2 │ │ └── Release │ │ │ └── libtiff.dll │ ├── SDL-1.2 │ │ ├── VisualC │ │ │ └── SDL │ │ │ │ └── Release │ │ │ │ └── SDL.dll │ │ └── include │ │ │ └── SDL.h │ ├── SDL_mixer-1.2 │ │ └── Release │ │ │ └── SDL_mixer.dll │ ├── include │ │ ├── SDL_mixer.h │ │ ├── SDL │ │ │ ├── SDL_image.h │ │ │ ├── SDL_ttf.h │ │ │ └── jpeglib.h │ │ └── libpng12 │ │ │ └── png.h │ ├── libvorbis-1.2.0 │ │ └── Release │ │ │ ├── libvorbis-0.dll │ │ │ └── libvorbisfile-3.dll │ └── SDL_image-1.2.6 │ │ └── VisualC │ │ └── Release │ │ └── SDL_image.dll ├── Setup_Win_Common.in ├── test-sdl-config └── readme.txt ├── test ├── midi_tags.py ├── run_tests__tests │ ├── __init__.py │ ├── all_ok │ │ ├── __init__.py │ │ ├── zero_tests_test.py │ │ ├── no_assertions__ret_code_of_1__test.py │ │ ├── fake_2_test.py │ │ ├── fake_3_test.py │ │ ├── fake_4_test.py │ │ ├── fake_5_test.py │ │ └── fake_6_test.py │ ├── exclude │ │ ├── __init__.py │ │ ├── magic_tag_test.py │ │ ├── fake_2_test.py │ │ └── invisible_tag_test.py │ ├── timeout │ │ ├── __init__.py │ │ ├── sleep_test.py │ │ └── fake_2_test.py │ ├── everything │ │ ├── __init__.py │ │ ├── sleep_test.py │ │ ├── magic_tag_test.py │ │ ├── fake_2_test.py │ │ └── incomplete_todo_test.py │ ├── failures1 │ │ ├── __init__.py │ │ ├── fake_2_test.py │ │ ├── fake_3_test.py │ │ └── fake_4_test.py │ ├── incomplete │ │ ├── __init__.py │ │ ├── fake_2_test.py │ │ └── fake_3_test.py │ ├── print_stderr │ │ ├── __init__.py │ │ ├── fake_2_test.py │ │ ├── fake_3_test.py │ │ └── fake_4_test.py │ ├── print_stdout │ │ ├── __init__.py │ │ ├── fake_2_test.py │ │ ├── fake_4_test.py │ │ └── fake_3_test.py │ ├── incomplete_todo │ │ ├── __init__.py │ │ ├── fake_3_test.py │ │ └── fake_2_test.py │ └── infinite_loop │ │ ├── __init__.py │ │ ├── fake_2_test.py │ │ └── fake_1_test.py ├── cdrom_tags.py ├── test_test_.py ├── util │ ├── build_page │ │ ├── libs │ │ │ ├── build_client │ │ │ │ ├── __init__.py │ │ │ │ ├── config │ │ │ │ │ ├── auth.txt │ │ │ │ │ ├── build_config.template │ │ │ │ │ └── build_py25_exe.template │ │ │ │ ├── test_fixtures │ │ │ │ │ ├── BUILD_FAILED │ │ │ │ │ ├── TESTS_FAILED │ │ │ │ │ ├── TESTS_INVALID │ │ │ │ │ ├── BUILD_FAILED_UNKNOWN │ │ │ │ │ ├── BUILD_LINK_FAILED │ │ │ │ │ ├── BUILD_FAILED_EXCEPTION │ │ │ │ │ ├── BUILD_FAILED_UNPARSEABLE │ │ │ │ │ └── TESTS_PASSED │ │ │ │ └── upload_results.py │ │ │ ├── pywebsite │ │ │ │ ├── __init__.py │ │ │ │ ├── helpers.py │ │ │ │ ├── zdb.py │ │ │ │ └── escape.py │ │ │ └── process_results.py │ │ ├── remote_push.bat │ │ ├── .htaccess │ │ ├── results │ │ │ ├── .htaccess │ │ │ ├── results.css │ │ │ └── index.py │ │ ├── upload_results │ │ │ ├── .htaccess │ │ │ └── index.py │ │ └── warnings.php │ └── gen_stubs_test.py ├── fixtures │ ├── fonts │ │ ├── test_sans.ttf │ │ ├── PyGameMono.otf │ │ ├── test_fixed.otf │ │ ├── A_PyGameMono-8.png │ │ ├── u13079_PyGameMono-8.png │ │ └── PyGameMono-8.bdf │ └── xbm_cursors │ │ ├── white_sizing.xbm │ │ └── white_sizing_mask.xbm ├── image_tags.py ├── mixer_tags.py ├── imageext_tags.py ├── mixer_music_tags.py ├── font_tags.py ├── ftfont_tags.py ├── freetype_tags.py ├── sndarray_tags.py ├── surfarray_tags.py ├── scrap_tags.py ├── test_utils │ └── endian.py ├── camera_test.py ├── ftfont_test.py ├── __init__.py ├── overlay_test.py ├── sysfont_test.py └── image__save_gl_surface_test.py ├── symbian ├── lib │ ├── base.py │ ├── color.py │ ├── draw.py │ ├── event.py │ ├── font.py │ ├── image.py │ ├── key.py │ ├── rect.py │ ├── time.py │ ├── display.py │ ├── gfxdraw.py │ ├── overlay.py │ ├── surface.py │ ├── surflock.py │ ├── constants.py │ ├── fastevent.py │ ├── imageext.py │ ├── pixelarray.py │ ├── rwobject.py │ ├── transform.py │ ├── bufferproxy.py │ └── mixer.py ├── app │ ├── launcher │ │ └── logo.jpg │ ├── pygame.hrh │ ├── pygame_reg.rss │ └── pygame.rss ├── default_build_config.py ├── SConscript.Ogg.py ├── SConscript.libpng.py ├── changes_for_symbian.txt ├── pygame_pkgtemplate.txt ├── SConscript.Vorbis.py └── configure.py ├── docs ├── reST │ ├── ext │ │ ├── __init__.py │ │ └── headers.py │ ├── ref │ │ ├── common.txt │ │ ├── code_examples │ │ │ ├── joystick_calls.png │ │ │ └── draw_module_example.png │ │ └── locals.rst │ ├── _static │ │ ├── pygame.ico │ │ ├── pygame_tiny.png │ │ ├── tooltip.css │ │ └── reset.css │ ├── tut │ │ ├── camera_hsv.jpg │ │ ├── camera_rgb.jpg │ │ ├── camera_yuv.jpg │ │ ├── chimpshot.gif │ │ ├── intro_ball.gif │ │ ├── surfarray.png │ │ ├── tom_basic.png │ │ ├── camera_green.jpg │ │ ├── camera_mask.jpg │ │ ├── intro_blade.jpg │ │ ├── tom_formulae.png │ │ ├── tom_radians.png │ │ ├── camera_average.jpg │ │ ├── camera_thresh.jpg │ │ ├── intro_freedom.jpg │ │ ├── surfarray_xfade.png │ │ ├── camera_background.jpg │ │ ├── surfarray_flipped.png │ │ ├── surfarray_redimg.png │ │ ├── surfarray_scaleup.png │ │ ├── surfarray_soften.png │ │ ├── surfarray_striped.png │ │ ├── camera_thresholded.jpg │ │ ├── surfarray_allblack.png │ │ ├── surfarray_rgbarray.png │ │ ├── surfarray_scaledown.png │ │ ├── tom_event-flowchart.png │ │ ├── common.txt │ │ └── chimp.py.rst │ ├── themes │ │ └── classic │ │ │ ├── page.html │ │ │ ├── theme.conf │ │ │ └── elements.html │ ├── common.txt │ ├── filepaths.rst │ └── _templates │ │ └── header.h ├── pygame_logo.gif ├── pygame_tiny.gif ├── pygame_powered.gif ├── pygame_small.gif ├── __init__.py ├── __main__.py └── logos.html ├── lib ├── gp2x │ ├── locals.py │ ├── constants.py │ └── __init__.py ├── pygame.ico ├── freesansbold.ttf ├── pygame_icon.bmp ├── pygame_icon.icns ├── pygame_icon.tiff ├── _dummybackend.py ├── macosx.py └── locals.py ├── Setup_Win_Common.in ├── obj ├── win32 │ └── scale_mmx.obj └── win64 │ └── scale_mmx.obj ├── src ├── SDL_gfx │ └── SDL_gfxPrimitives_font.h ├── doc │ ├── locals_doc.h │ ├── tests_doc.h │ ├── cursors_doc.h │ ├── overlay_doc.h │ ├── bufferproxy_doc.h │ ├── pixelcopy_doc.h │ ├── sndarray_doc.h │ ├── scrap_doc.h │ ├── image_doc.h │ ├── key_doc.h │ └── mouse_doc.h ├── pgopengl.h ├── mask.h ├── _camera.h ├── _surface.h ├── pgarrinter.h ├── pygame.h ├── scale_mmx.c ├── fastevents.h └── font.h ├── Setup_Unix.in ├── configure ├── appveyor ├── README.rst └── install.ps1 ├── manylinux-build ├── docker_base │ ├── flac │ │ ├── flac.sha512 │ │ └── build-flac.sh │ ├── libpng │ │ ├── png.sha512 │ │ └── build-png.sh │ ├── libwebp │ │ ├── webp.sha512 │ │ └── build-webp.sh │ ├── freetype │ │ ├── freetype.sha512 │ │ └── build-freetype.sh │ ├── portmidi │ │ ├── portmidi.sha512 │ │ └── build-portmidi.sh │ ├── fluidsynth │ │ ├── fluidsynth.sha512 │ │ └── build-fluidsynth.sh │ ├── ogg │ │ ├── ogg.sha512 │ │ └── build-ogg.sh │ ├── sdl_libs │ │ └── sdl.sha512 │ ├── Dockerfile-x86_64 │ ├── Dockerfile-i686 │ └── RPM-GPG-KEY.dag.txt ├── build-wheels.sh └── Makefile ├── Setup_Darwin.in ├── run_tests.py ├── .travis_osx.sh ├── MANIFEST.in ├── .hgignore ├── Makefile ├── .travis_osx_install.sh ├── .travis_osx_after_success.sh ├── makeref.py ├── mingwcfg.py ├── setmods ├── check_test.py ├── bdist_mpkg_support.py ├── setup_win_common.py ├── .travis_osx_rename_whl.py ├── version.py.in ├── .hgtags ├── mingw32distutils.py ├── msysio.py ├── trackmod └── namereg.py ├── .travis_osx_upload_whl.py └── distutils_mods.py /examples/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gdbinit: -------------------------------------------------------------------------------- 1 | set breakpoint pending on 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/SDL.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/jpeg.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/smpeg.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/zlib1.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /test/midi_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = ['interactive'] 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/SDL_image.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/SDL_ttf.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/libogg-0.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/libpng12-0.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/libtiff.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/lib/SDL_mixer.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/lib/libjpeg.dll.a: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/lib/libpng12.dll.a: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /symbian/lib/base.py: -------------------------------------------------------------------------------- 1 | from pygame_base import * 2 | -------------------------------------------------------------------------------- /symbian/lib/color.py: -------------------------------------------------------------------------------- 1 | from pygame_color import * 2 | -------------------------------------------------------------------------------- /symbian/lib/draw.py: -------------------------------------------------------------------------------- 1 | from pygame_draw import * 2 | -------------------------------------------------------------------------------- /symbian/lib/event.py: -------------------------------------------------------------------------------- 1 | from pygame_event import * 2 | -------------------------------------------------------------------------------- /symbian/lib/font.py: -------------------------------------------------------------------------------- 1 | from pygame_font import * 2 | -------------------------------------------------------------------------------- /symbian/lib/image.py: -------------------------------------------------------------------------------- 1 | from pygame_image import * 2 | -------------------------------------------------------------------------------- /symbian/lib/key.py: -------------------------------------------------------------------------------- 1 | from pygame_key import * 2 | -------------------------------------------------------------------------------- /symbian/lib/rect.py: -------------------------------------------------------------------------------- 1 | from pygame_rect import * 2 | -------------------------------------------------------------------------------- /symbian/lib/time.py: -------------------------------------------------------------------------------- 1 | from pygame_time import * 2 | -------------------------------------------------------------------------------- /test/cdrom_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = ['interactive'] 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/all_ok/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/exclude/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/timeout/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /test/test_test_.py: -------------------------------------------------------------------------------- 1 | while True: 2 | pass 3 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configtest/testdir/bin/libfreetype-6.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/libvorbis-0.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/bin/libvorbisfile-3.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/lib/libSDL_image.dll.a: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/lib/libSDL_mixer.dll.a: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/lib/libSDL_ttf.dll.a: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/smpeg/Release/smpeg.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /docs/reST/ext/__init__.py: -------------------------------------------------------------------------------- 1 | # Make this a package 2 | 3 | -------------------------------------------------------------------------------- /symbian/lib/display.py: -------------------------------------------------------------------------------- 1 | from pygame_display import * 2 | -------------------------------------------------------------------------------- /symbian/lib/gfxdraw.py: -------------------------------------------------------------------------------- 1 | from pygame_gfxdraw import * 2 | -------------------------------------------------------------------------------- /symbian/lib/overlay.py: -------------------------------------------------------------------------------- 1 | from pygame_overlay import * 2 | -------------------------------------------------------------------------------- /symbian/lib/surface.py: -------------------------------------------------------------------------------- 1 | from pygame_surface import * 2 | -------------------------------------------------------------------------------- /symbian/lib/surflock.py: -------------------------------------------------------------------------------- 1 | from pygame_surflock import * 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/everything/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/failures1/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/incomplete/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/print_stderr/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/print_stdout/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /configtest/testdir/jpeg-6b/Release/jpeg.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/zlib-1.2.3/Release/zlib1.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /docs/reST/ref/common.txt: -------------------------------------------------------------------------------- 1 | .. include:: ../common.txt 2 | 3 | -------------------------------------------------------------------------------- /symbian/lib/constants.py: -------------------------------------------------------------------------------- 1 | from pygame_constants import * 2 | -------------------------------------------------------------------------------- /symbian/lib/fastevent.py: -------------------------------------------------------------------------------- 1 | from pygame_fastevent import * 2 | -------------------------------------------------------------------------------- /symbian/lib/imageext.py: -------------------------------------------------------------------------------- 1 | from pygame_imageext import * 2 | -------------------------------------------------------------------------------- /symbian/lib/pixelarray.py: -------------------------------------------------------------------------------- 1 | from pygame_pixelarray import * 2 | -------------------------------------------------------------------------------- /symbian/lib/rwobject.py: -------------------------------------------------------------------------------- 1 | from pygame_rwobject import * 2 | -------------------------------------------------------------------------------- /symbian/lib/transform.py: -------------------------------------------------------------------------------- 1 | from pygame_transform import * 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/incomplete_todo/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /test/run_tests__tests/infinite_loop/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/config/auth.txt: -------------------------------------------------------------------------------- 1 | user:pass -------------------------------------------------------------------------------- /configtest/testdir/SDL_ttf-2.0.9/Release/SDL_ttf.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/libogg-1.1.3/Release/libogg-0.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/libpng-1.2.32/lib/libpng13.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/tiff-3.8.2/Release/libtiff.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /lib/gp2x/locals.py: -------------------------------------------------------------------------------- 1 | 2 | from pygame.gp2x.constants import * 3 | 4 | -------------------------------------------------------------------------------- /symbian/lib/bufferproxy.py: -------------------------------------------------------------------------------- 1 | from pygame_bufferproxy import * 2 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/test_fixtures/BUILD_FAILED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/test_fixtures/TESTS_FAILED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/test_fixtures/TESTS_INVALID: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configtest/testdir/SDL-1.2/VisualC/SDL/Release/SDL.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/SDL_mixer-1.2/Release/SDL_mixer.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/include/SDL_mixer.h: -------------------------------------------------------------------------------- 1 | /* Just a bogus header file */ 2 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/test_fixtures/BUILD_FAILED_UNKNOWN: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/test_fixtures/BUILD_LINK_FAILED: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configtest/testdir/SDL-1.2/include/SDL.h: -------------------------------------------------------------------------------- 1 | /* Just a bogus header file */ 2 | -------------------------------------------------------------------------------- /configtest/testdir/include/SDL/SDL_image.h: -------------------------------------------------------------------------------- 1 | /* Just a bogus header file */ 2 | -------------------------------------------------------------------------------- /configtest/testdir/include/SDL/SDL_ttf.h: -------------------------------------------------------------------------------- 1 | /* Just a bogus header file */ 2 | -------------------------------------------------------------------------------- /configtest/testdir/include/SDL/jpeglib.h: -------------------------------------------------------------------------------- 1 | /* Just a bogus header file */ 2 | -------------------------------------------------------------------------------- /configtest/testdir/include/libpng12/png.h: -------------------------------------------------------------------------------- 1 | /* Just a bogus header file */ 2 | -------------------------------------------------------------------------------- /configtest/testdir/libvorbis-1.2.0/Release/libvorbis-0.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /configtest/testdir/libvorbis-1.2.0/Release/libvorbisfile-3.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/test_fixtures/BUILD_FAILED_EXCEPTION: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/test_fixtures/BUILD_FAILED_UNPARSEABLE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /configtest/testdir/SDL_image-1.2.6/VisualC/Release/SDL_image.dll: -------------------------------------------------------------------------------- 1 | A bogus DLL 2 | -------------------------------------------------------------------------------- /lib/pygame.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/lib/pygame.ico -------------------------------------------------------------------------------- /symbian/lib/mixer.py: -------------------------------------------------------------------------------- 1 | from pygame_mixer import * 2 | import pygame_mixer_music as music -------------------------------------------------------------------------------- /docs/pygame_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/pygame_logo.gif -------------------------------------------------------------------------------- /docs/pygame_tiny.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/pygame_tiny.gif -------------------------------------------------------------------------------- /lib/freesansbold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/lib/freesansbold.ttf -------------------------------------------------------------------------------- /lib/pygame_icon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/lib/pygame_icon.bmp -------------------------------------------------------------------------------- /lib/pygame_icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/lib/pygame_icon.icns -------------------------------------------------------------------------------- /lib/pygame_icon.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/lib/pygame_icon.tiff -------------------------------------------------------------------------------- /test/util/build_page/remote_push.bat: -------------------------------------------------------------------------------- 1 | rsync -za * -e ssh wazoocom@wazoo.com.au:~/www/pygame/ -------------------------------------------------------------------------------- /Setup_Win_Common.in: -------------------------------------------------------------------------------- 1 | # Windows specific flags for Pygame modules. 2 | SCRAP = -luser32 -lgdi32 3 | -------------------------------------------------------------------------------- /docs/pygame_powered.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/pygame_powered.gif -------------------------------------------------------------------------------- /docs/pygame_small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/pygame_small.gif -------------------------------------------------------------------------------- /examples/data/blue.mpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/blue.mpg -------------------------------------------------------------------------------- /examples/data/bomb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/bomb.gif -------------------------------------------------------------------------------- /examples/data/boom.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/boom.wav -------------------------------------------------------------------------------- /examples/data/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/brick.png -------------------------------------------------------------------------------- /examples/data/chimp.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/chimp.bmp -------------------------------------------------------------------------------- /examples/data/city.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/city.png -------------------------------------------------------------------------------- /examples/data/fist.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/fist.bmp -------------------------------------------------------------------------------- /examples/data/punch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/punch.wav -------------------------------------------------------------------------------- /examples/data/sans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/sans.ttf -------------------------------------------------------------------------------- /examples/data/shot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/shot.gif -------------------------------------------------------------------------------- /examples/data/whiff.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/whiff.wav -------------------------------------------------------------------------------- /examples/data/yuv_1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/yuv_1.pgm -------------------------------------------------------------------------------- /obj/win32/scale_mmx.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/obj/win32/scale_mmx.obj -------------------------------------------------------------------------------- /obj/win64/scale_mmx.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/obj/win64/scale_mmx.obj -------------------------------------------------------------------------------- /examples/data/alien1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/alien1.gif -------------------------------------------------------------------------------- /examples/data/alien1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/alien1.jpg -------------------------------------------------------------------------------- /examples/data/alien1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/alien1.png -------------------------------------------------------------------------------- /examples/data/alien2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/alien2.gif -------------------------------------------------------------------------------- /examples/data/alien2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/alien2.png -------------------------------------------------------------------------------- /examples/data/alien3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/alien3.gif -------------------------------------------------------------------------------- /examples/data/alien3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/alien3.png -------------------------------------------------------------------------------- /examples/data/asprite.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/asprite.bmp -------------------------------------------------------------------------------- /examples/data/danger.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/danger.gif -------------------------------------------------------------------------------- /examples/data/liquid.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/liquid.bmp -------------------------------------------------------------------------------- /examples/data/player1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/player1.gif -------------------------------------------------------------------------------- /examples/data/static.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/static.png -------------------------------------------------------------------------------- /configtest/Setup_Win_Common.in: -------------------------------------------------------------------------------- 1 | # Windows specific flags for Pygame modules. 2 | SCRAP = -luser32 -lgdi32 3 | -------------------------------------------------------------------------------- /docs/reST/_static/pygame.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/_static/pygame.ico -------------------------------------------------------------------------------- /docs/reST/tut/camera_hsv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/camera_hsv.jpg -------------------------------------------------------------------------------- /docs/reST/tut/camera_rgb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/camera_rgb.jpg -------------------------------------------------------------------------------- /docs/reST/tut/camera_yuv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/camera_yuv.jpg -------------------------------------------------------------------------------- /docs/reST/tut/chimpshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/chimpshot.gif -------------------------------------------------------------------------------- /docs/reST/tut/intro_ball.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/intro_ball.gif -------------------------------------------------------------------------------- /docs/reST/tut/surfarray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray.png -------------------------------------------------------------------------------- /docs/reST/tut/tom_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/tom_basic.png -------------------------------------------------------------------------------- /examples/data/arraydemo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/arraydemo.bmp -------------------------------------------------------------------------------- /examples/data/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/background.gif -------------------------------------------------------------------------------- /examples/data/car_door.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/car_door.wav -------------------------------------------------------------------------------- /examples/data/explosion1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/explosion1.gif -------------------------------------------------------------------------------- /examples/data/house_lo.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/house_lo.mp3 -------------------------------------------------------------------------------- /examples/data/house_lo.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/house_lo.ogg -------------------------------------------------------------------------------- /examples/data/house_lo.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/house_lo.wav -------------------------------------------------------------------------------- /examples/data/midikeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/midikeys.png -------------------------------------------------------------------------------- /examples/data/oldplayer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/oldplayer.gif -------------------------------------------------------------------------------- /docs/reST/tut/camera_green.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/camera_green.jpg -------------------------------------------------------------------------------- /docs/reST/tut/camera_mask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/camera_mask.jpg -------------------------------------------------------------------------------- /docs/reST/tut/intro_blade.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/intro_blade.jpg -------------------------------------------------------------------------------- /docs/reST/tut/tom_formulae.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/tom_formulae.png -------------------------------------------------------------------------------- /docs/reST/tut/tom_radians.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/tom_radians.png -------------------------------------------------------------------------------- /examples/data/secosmic_lo.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/data/secosmic_lo.wav -------------------------------------------------------------------------------- /symbian/app/launcher/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/symbian/app/launcher/logo.jpg -------------------------------------------------------------------------------- /docs/reST/_static/pygame_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/_static/pygame_tiny.png -------------------------------------------------------------------------------- /docs/reST/tut/camera_average.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/camera_average.jpg -------------------------------------------------------------------------------- /docs/reST/tut/camera_thresh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/camera_thresh.jpg -------------------------------------------------------------------------------- /docs/reST/tut/intro_freedom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/intro_freedom.jpg -------------------------------------------------------------------------------- /docs/reST/tut/surfarray_xfade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray_xfade.png -------------------------------------------------------------------------------- /test/fixtures/fonts/test_sans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/test/fixtures/fonts/test_sans.ttf -------------------------------------------------------------------------------- /docs/reST/tut/camera_background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/camera_background.jpg -------------------------------------------------------------------------------- /docs/reST/tut/surfarray_flipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray_flipped.png -------------------------------------------------------------------------------- /docs/reST/tut/surfarray_redimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray_redimg.png -------------------------------------------------------------------------------- /docs/reST/tut/surfarray_scaleup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray_scaleup.png -------------------------------------------------------------------------------- /docs/reST/tut/surfarray_soften.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray_soften.png -------------------------------------------------------------------------------- /docs/reST/tut/surfarray_striped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray_striped.png -------------------------------------------------------------------------------- /test/fixtures/fonts/PyGameMono.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/test/fixtures/fonts/PyGameMono.otf -------------------------------------------------------------------------------- /test/fixtures/fonts/test_fixed.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/test/fixtures/fonts/test_fixed.otf -------------------------------------------------------------------------------- /docs/reST/tut/camera_thresholded.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/camera_thresholded.jpg -------------------------------------------------------------------------------- /docs/reST/tut/surfarray_allblack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray_allblack.png -------------------------------------------------------------------------------- /docs/reST/tut/surfarray_rgbarray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray_rgbarray.png -------------------------------------------------------------------------------- /docs/reST/tut/surfarray_scaledown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/surfarray_scaledown.png -------------------------------------------------------------------------------- /docs/reST/tut/tom_event-flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/tut/tom_event-flowchart.png -------------------------------------------------------------------------------- /src/SDL_gfx/SDL_gfxPrimitives_font.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/src/SDL_gfx/SDL_gfxPrimitives_font.h -------------------------------------------------------------------------------- /test/fixtures/fonts/A_PyGameMono-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/test/fixtures/fonts/A_PyGameMono-8.png -------------------------------------------------------------------------------- /test/util/build_page/.htaccess: -------------------------------------------------------------------------------- 1 | Options +FollowSymLinks +ExecCGI 2 | AddHandler cgi-script py 3 | 4 | DirectoryIndex index.php -------------------------------------------------------------------------------- /Setup_Unix.in: -------------------------------------------------------------------------------- 1 | #This file defines platform specific modules for linux 2 | _camera src/_camera.c src/camera_v4l2.c $(SDL) $(DEBUG) 3 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #fake configure for pygame, to support the common 2 | # ./configure;make;make install 3 | 4 | python config.py -auto 5 | -------------------------------------------------------------------------------- /test/fixtures/fonts/u13079_PyGameMono-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/test/fixtures/fonts/u13079_PyGameMono-8.png -------------------------------------------------------------------------------- /docs/reST/ref/code_examples/joystick_calls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/ref/code_examples/joystick_calls.png -------------------------------------------------------------------------------- /test/util/build_page/results/.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteRule ^([^/]+)/([0-9]+)(?:/(.*))?$ index.py?platform_id=$1&revision=$2&info=$3 -------------------------------------------------------------------------------- /appveyor/README.rst: -------------------------------------------------------------------------------- 1 | Appveyor is a service we use to build windows binaries for pygame. 2 | 3 | 4 | https://ci.appveyor.com/project/pygame/pygame-temp-m8dun -------------------------------------------------------------------------------- /docs/reST/ref/code_examples/draw_module_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/docs/reST/ref/code_examples/draw_module_example.png -------------------------------------------------------------------------------- /examples/macosx/aliens_app_example/English.lproj/aliens.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/macosx/aliens_app_example/English.lproj/aliens.icns -------------------------------------------------------------------------------- /test/image_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = [] 2 | 3 | import pygame 4 | import sys 5 | if 'pygame.image' not in sys.modules: 6 | __tags__.extend(('ignore', 'subprocess_ignore')) 7 | 8 | -------------------------------------------------------------------------------- /test/mixer_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = [] 2 | 3 | import pygame 4 | import sys 5 | if 'pygame.mixer' not in sys.modules: 6 | __tags__.extend(('ignore', 'subprocess_ignore')) 7 | 8 | -------------------------------------------------------------------------------- /test/imageext_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = [] 2 | 3 | import pygame 4 | import sys 5 | if 'pygame.imageext' not in sys.modules: 6 | __tags__.extend(('ignore', 'subprocess_ignore')) 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/mixer_music_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = [] 2 | 3 | import pygame 4 | import sys 5 | if 'pygame.mixer_music' not in sys.modules: 6 | __tags__.extend(('ignore', 'subprocess_ignore')) 7 | 8 | -------------------------------------------------------------------------------- /docs/reST/tut/common.txt: -------------------------------------------------------------------------------- 1 | .. Common definitions for tutorials 2 | 3 | .. include:: ../common.txt 4 | 5 | .. role:: codelineref 6 | 7 | .. role:: clr(codelineref) 8 | :class: codelineref 9 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/flac/flac.sha512: -------------------------------------------------------------------------------- 1 | 923cd0ffe2155636febf2b4633791bc83370d57080461b97ebb69ea21a4b1be7c0ff376c7fc8ca3979af4714e761112114a24b49ff6c80228b58b929db6e96d5 flac-1.3.1.tar.xz 2 | -------------------------------------------------------------------------------- /Setup_Darwin.in: -------------------------------------------------------------------------------- 1 | #This file defines platform specific modules for mac os x 2 | SCRAP = 3 | sdlmain_osx src/sdlmain_osx.m $(SDL) $(DEBUG) 4 | #_camera src/_camera.c src/camera_mac.m $(SDL) $(DEBUG) 5 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/libpng/png.sha512: -------------------------------------------------------------------------------- 1 | f5cf137186fc0a10deb3ce54b1961cb9a358cec380cd3f8c21d2726e68348574c49a5a6808ecd79736737e970fa41ae83626811cb72b059bbf6054fabf6639f8 libpng-1.6.23.tar.gz 2 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/libwebp/webp.sha512: -------------------------------------------------------------------------------- 1 | 931b2dce29ee664d9a0bbc614ed19992c3ca52dd886d504dcca2df82c8f815e723bd03be7ae35a186ae555b09b0e31a17eb834871ff0728ab15ab24548b630ee libwebp-0.5.1.tar.gz 2 | -------------------------------------------------------------------------------- /symbian/app/pygame.hrh: -------------------------------------------------------------------------------- 1 | enum 2 | { 3 | ETestDsa = 0x5000, 4 | ETestDsbDb, 5 | ETestDsbIu, 6 | ETestDsbDbA, 7 | ETestDsbIuA, 8 | ETestGdi, 9 | ETestViewBuildDate 10 | }; 11 | -------------------------------------------------------------------------------- /examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/takluyver/pygame/HEAD/examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/keyedobjects.nib -------------------------------------------------------------------------------- /manylinux-build/docker_base/freetype/freetype.sha512: -------------------------------------------------------------------------------- 1 | 4014dd4971e65b840d9a8902febd5b97b081b3e0736a1d087ef5388a3ed64c21b371642f29017dc3249911a7615e34654c42be27a490416bfe6c4349701243e8 freetype-2.6.5.tar.gz 2 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/portmidi/portmidi.sha512: -------------------------------------------------------------------------------- 1 | d08d4d57429d26d292b5fe6868b7c7a32f2f1d2428f6695cd403a697e2d91629bd4380242ab2720e8f21c895bb75cb56b709fb663a20e8e623120e50bfc5d90b portmidi-src-217.zip 2 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/fluidsynth/fluidsynth.sha512: -------------------------------------------------------------------------------- 1 | 2dcb8a8a1634273cc93c45b6e21b87ac45a023c768cffdadda0a4e611eab8d5bbea0e1ba59e5f147488054cfa6fcaf561399ae275a665c76082b8738a80778bb fluidsynth-1.1.6.tar.gz 2 | -------------------------------------------------------------------------------- /configtest/test-sdl-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ARGS="$@" 3 | if [ "$ARGS" = '--version --cflags --libs' ]; then 4 | echo '1.2.13' 5 | echo '-I./SDL/include -DSDL_MACRO=1 -Wl,sdl_1,sdl_2' 6 | echo '-L./SDL/lib -lSDL' 7 | fi 8 | -------------------------------------------------------------------------------- /run_tests.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """Run one or more Pygame unittest modules in the test directory 4 | 5 | For command line options use the --help option. 6 | 7 | """ 8 | 9 | import test.__main__ 10 | 11 | -------------------------------------------------------------------------------- /docs/reST/tut/chimp.py.rst: -------------------------------------------------------------------------------- 1 | .. include:: common.txt 2 | 3 | **************************** 4 | pygame/examples/chimp.py 5 | **************************** 6 | 7 | .. literalinclude:: ../../../examples/chimp.py 8 | :language: python 9 | -------------------------------------------------------------------------------- /docs/reST/themes/classic/page.html: -------------------------------------------------------------------------------- 1 | {%- extends "elements.html" %} 2 | 3 | {%- block document %} 4 | {{ header() }} 5 | {{ super() }} 6 | {%- endblock %} 7 | 8 | {%- block section %} 9 | {{ body }} 10 | {%- endblock %} 11 | -------------------------------------------------------------------------------- /test/font_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = [] 2 | 3 | import sys 4 | # Font support not fully implemented for Python 3.x. 5 | if sys.version_info >= (3, 0, 0) and sys.platform.startswith('win'): 6 | __tags__.extend(['ignore', 'subprocess_ignore']) 7 | 8 | -------------------------------------------------------------------------------- /test/ftfont_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = ['development'] 2 | 3 | exclude = False 4 | 5 | try: 6 | import pygame.ftfont 7 | except ImportError: 8 | exclude = True 9 | 10 | if exclude: 11 | __tags__.extend(['ignore', 'subprocess_ignore']) 12 | 13 | -------------------------------------------------------------------------------- /test/freetype_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = ['development'] 2 | 3 | exclude = False 4 | 5 | try: 6 | import pygame.freetype 7 | except ImportError: 8 | exclude = True 9 | 10 | if exclude: 11 | __tags__.extend(['ignore', 'subprocess_ignore']) 12 | 13 | -------------------------------------------------------------------------------- /test/util/build_page/libs/pywebsite/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # Std Libs 4 | import cgi 5 | print "Content-Type: text/html\n" 6 | 7 | import cgitb 8 | cgitb.enable() 9 | 10 | from escape import * 11 | from helpers import * 12 | from zdb import * -------------------------------------------------------------------------------- /test/sndarray_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = ['array'] 2 | 3 | exclude = False 4 | 5 | try: 6 | import pygame.mixer 7 | import numpy 8 | except ImportError: 9 | exclude = True 10 | 11 | if exclude: 12 | __tags__.extend(('ignore', 'subprocess_ignore')) 13 | -------------------------------------------------------------------------------- /src/doc/locals_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMELOCALS "pygame constants" 3 | 4 | 5 | 6 | /* Docs in a comment... slightly easier to read. */ 7 | 8 | /* 9 | 10 | pygame.locals 11 | pygame constants 12 | 13 | */ -------------------------------------------------------------------------------- /docs/reST/common.txt: -------------------------------------------------------------------------------- 1 | .. Pygame specific reST elements. 2 | 3 | .. role:: summaryline 4 | 5 | .. role:: sl(summaryline) 6 | :class: summaryline 7 | 8 | .. role:: signature 9 | 10 | .. role:: sg(signature) 11 | :class: signature 12 | 13 | .. role:: small-heading 14 | :class: small-heading 15 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/test_fixtures/TESTS_PASSED: -------------------------------------------------------------------------------- 1 | loading sprite_test 2 | ....................................................................................................... 3 | ---------------------------------------------------------------------- 4 | Ran 103 tests in 0.120s 5 | 6 | OK 7 | 8 | -------------------------------------------------------------------------------- /.travis_osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | git clone https://github.com/MacPython/terryfy.git 5 | cd terryfy 6 | # Work with a specific commit 7 | git checkout b48eff2ea5f194d404e88235cec7f270a8e5f24f 8 | cd .. 9 | source terryfy/travis_tools.sh 10 | get_python_environment homebrew $PY_VERSION $(pwd)/_test_env 11 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include Setup.in Setup_Darwin.in Setup_Unix.in Setup_Win_Common.in *.py WHATSNEW readme.rst install.html readme.html LGPL version.py.in 2 | 3 | recursive-include docs * 4 | recursive-include lib * 5 | recursive-include src * 6 | recursive-include examples * 7 | recursive-include test * 8 | prune */CVS 9 | prune */*/CVS 10 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/ogg/ogg.sha512: -------------------------------------------------------------------------------- 1 | 4a659bfa2851cdb7db6b852fa744ea594426e657cb74b9b0153f9c8b88e5cc836f1f7749d8e279248ffa7c550f25ef36eb68c379d5cf45e63f6b1be780de65fa libogg-1.3.2.tar.gz 2 | 6c729a227143abc744a779ec4d4ce9932cd1234e301b766cb5111c3894b7cd866f0267590c7864afd3841ac0d4ae2eb2386e8d14345b7c41c8ce35e996e3656c libvorbis-1.3.5.tar.gz 3 | -------------------------------------------------------------------------------- /docs/__init__.py: -------------------------------------------------------------------------------- 1 | # Make docs a package that brings up the main page in a web brower when 2 | # executed. 3 | # 4 | # python -m pygame.docs 5 | 6 | if __name__ == '__main__': 7 | import os 8 | pkg_dir = os.path.dirname(os.path.abspath(__file__)) 9 | main = os.path.join(pkg_dir, '__main__.py') 10 | execfile(main) 11 | 12 | 13 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/libpng/build-png.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | cd $(dirname `readlink -f "$0"`) 5 | 6 | PNG=libpng-1.6.23 7 | 8 | curl -sL http://download.sourceforge.net/libpng/${PNG}.tar.gz > ${PNG}.tar.gz 9 | sha512sum -c png.sha512 10 | 11 | tar xzf ${PNG}.tar.gz 12 | cd $PNG 13 | ./configure 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /symbian/app/pygame_reg.rss: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | UID2 KUidAppRegistrationResourceFile 5 | UID3 __UID3__ 6 | 7 | RESOURCE APP_REGISTRATION_INFO 8 | { 9 | app_file = "pygame"; 10 | localisable_resource_file = "\\resource\\apps\\pygame"; 11 | localisable_resource_id = R_LOCALISABLE_APP_INFO; 12 | } 13 | -------------------------------------------------------------------------------- /test/surfarray_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = ['array'] 2 | 3 | exclude = False 4 | 5 | try: 6 | import numpy 7 | except ImportError: 8 | exclude = True 9 | else: 10 | try: 11 | import pygame.pixelcopy 12 | except ImportError: 13 | exclude = True 14 | 15 | if exclude: 16 | __tags__.extend(('ignore', 'subprocess_ignore')) 17 | -------------------------------------------------------------------------------- /test/util/gen_stubs_test.py: -------------------------------------------------------------------------------- 1 | ######################### PYGAME UNITTEST STUBBER TESTS ######################## 2 | """ 3 | 4 | TODO 5 | ==== 6 | 7 | tests for new stubber: deleted tests for missing units 8 | 9 | """ 10 | 11 | import pygame, unittest, gen_stubs 12 | 13 | 14 | ################################################################################ -------------------------------------------------------------------------------- /test/util/build_page/upload_results/.htaccess: -------------------------------------------------------------------------------- 1 | Options +FollowSymLinks +ExecCGI 2 | AddHandler cgi-script py 3 | 4 | AuthUserFile /home/wazoocom/secret/.htpasswd 5 | AuthGroupFile /dev/null 6 | AuthName "Contact the pygame mailing list for a password" 7 | AuthType Basic 8 | 9 | 10 | require valid-user 11 | 12 | 13 | DirectoryIndex index.py 14 | -------------------------------------------------------------------------------- /test/util/build_page/libs/pywebsite/helpers.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | ################################################################################ 4 | 5 | import pprint 6 | 7 | def pre_print(s): 8 | print '
%s
' % pprint.pformat(s) 9 | 10 | __all__ = ['pre_print'] 11 | 12 | ################################################################################ -------------------------------------------------------------------------------- /examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/JavaCompiling.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JavaSourceSubpath 6 | _MainMenu_EOArchive_English.java 7 | 8 | 9 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/libwebp/build-webp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | cd $(dirname `readlink -f "$0"`) 5 | 6 | WEBP=libwebp-0.5.1 7 | 8 | curl -sL http://storage.googleapis.com/downloads.webmproject.org/releases/webp/${WEBP}.tar.gz > ${WEBP}.tar.gz 9 | sha512sum -c webp.sha512 10 | 11 | tar xzf ${WEBP}.tar.gz 12 | cd $WEBP 13 | ./configure 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/freetype/build-freetype.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | cd $(dirname `readlink -f "$0"`) 5 | 6 | FREETYPE=freetype-2.6.5 7 | 8 | curl -sL http://download.savannah.gnu.org/releases/freetype/${FREETYPE}.tar.gz > ${FREETYPE}.tar.gz 9 | sha512sum -c freetype.sha512 10 | 11 | tar xzf ${FREETYPE}.tar.gz 12 | cd $FREETYPE 13 | ./configure 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ( 3 | {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 4 | { 5 | ACTIONS = {}; 6 | CLASS = PygameAppDelegate; 7 | LANGUAGE = ObjC; 8 | OUTLETS = {}; 9 | SUPERCLASS = NSObject; 10 | } 11 | ); 12 | IBVersion = 1; 13 | } -------------------------------------------------------------------------------- /test/fixtures/xbm_cursors/white_sizing.xbm: -------------------------------------------------------------------------------- 1 | #define resize_white_width 16 2 | #define resize_white_height 16 3 | #define resize_white_x_hot 7 4 | #define resize_white_y_hot 7 5 | static unsigned char resize_white_bits[] = { 6 | 0xff, 0x03, 0x01, 0x02, 0xfd, 0x03, 0x05, 0x00, 0xf5, 0x0f, 0x15, 0x08, 7 | 0xd5, 0xeb, 0x55, 0xaa, 0x55, 0xaa, 0xd7, 0xab, 0x10, 0xa8, 0xf0, 0xb7, 8 | 0x00, 0xa8, 0xc0, 0x9f, 0x40, 0x80, 0xc0, 0xff}; 9 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/flac/build-flac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | cd $(dirname `readlink -f "$0"`) 5 | 6 | FLAC=flac-1.3.1 7 | 8 | curl -sL http://downloads.xiph.org/releases/flac/${FLAC}.tar.xz > ${FLAC}.tar.xz 9 | sha512sum -c flac.sha512 10 | 11 | # The tar we have is too old to handle .tar.xz directly 12 | unxz ${FLAC}.tar.xz 13 | tar xf ${FLAC}.tar 14 | cd $FLAC 15 | ./configure 16 | make 17 | make install 18 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/fluidsynth/build-fluidsynth.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | cd $(dirname `readlink -f "$0"`) 5 | 6 | FSYNTH="fluidsynth-1.1.6" 7 | 8 | curl -sL https://downloads.sourceforge.net/project/fluidsynth/${FSYNTH}/${FSYNTH}.tar.gz > ${FSYNTH}.tar.gz 9 | sha512sum -c fluidsynth.sha512 10 | tar xzf ${FSYNTH}.tar.gz 11 | 12 | cd $FSYNTH 13 | mkdir build 14 | cd build 15 | cmake .. 16 | make 17 | make install 18 | -------------------------------------------------------------------------------- /test/fixtures/xbm_cursors/white_sizing_mask.xbm: -------------------------------------------------------------------------------- 1 | #define resize_white_mask_width 16 2 | #define resize_white_mask_height 16 3 | #define resize_white_mask_x_hot 7 4 | #define resize_white_mask_y_hot 7 5 | static unsigned char resize_white_mask_bits[] = { 6 | 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0x07, 0x00, 0xf7, 0x0f, 0xf7, 0x0f, 7 | 0xf7, 0xef, 0x77, 0xee, 0x77, 0xee, 0xf7, 0xef, 0xf0, 0xef, 0xf0, 0xff, 8 | 0x00, 0xf8, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff}; 9 | -------------------------------------------------------------------------------- /src/pgopengl.h: -------------------------------------------------------------------------------- 1 | #if !defined(PGOPENGL_H) 2 | #define PGOPENGL_H 3 | 4 | /** This header includes definitions of Opengl functions as pointer types for 5 | ** use with the SDL function SDL_GL_GetProcAddress. 6 | **/ 7 | 8 | #if defined(_WIN32) 9 | #define GL_APIENTRY __stdcall 10 | #else 11 | #define GL_APIENTRY 12 | #endif 13 | 14 | typedef void (GL_APIENTRY *GL_glReadPixels_Func)(int, int, int, int, unsigned int, unsigned int, void*); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /test/scrap_tags.py: -------------------------------------------------------------------------------- 1 | __tags__ = [] 2 | 3 | import sys 4 | 5 | exclude = False 6 | 7 | if sys.platform == 'win32' or sys.platform.startswith('linux'): 8 | try: 9 | import pygame 10 | pygame.scrap._NOT_IMPLEMENTED_ 11 | except AttributeError: 12 | pass 13 | else: 14 | exclude = True 15 | else: 16 | exclude = True 17 | 18 | if exclude: 19 | __tags__.extend(['ignore', 'subprocess_ignore']) 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /symbian/default_build_config.py: -------------------------------------------------------------------------------- 1 | # These are the defaults used by configure.py 2 | # when build_config.py does not exist 3 | build_python = False 4 | build_libs = True 5 | pys60_ce_src = '' 6 | pys60_sis = None 7 | pythondll = 'python25' 8 | pythoninclude = r'/epoc32/include/python25' 9 | pycompiler = "python" 10 | staticmods = False 11 | 12 | # Defaults for certificates 13 | cert = None 14 | privkey = None 15 | passphrase = None 16 | -------------------------------------------------------------------------------- /src/doc/tests_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMETESTS "Pygame unit test suite package" 3 | 4 | #define DOC_PYGAMETESTSRUN "run(*args, **kwds) -> tuple\nRun the Pygame unit test suite" 5 | 6 | 7 | 8 | /* Docs in a comment... slightly easier to read. */ 9 | 10 | /* 11 | 12 | pygame.tests 13 | Pygame unit test suite package 14 | 15 | pygame.tests.run 16 | run(*args, **kwds) -> tuple 17 | Run the Pygame unit test suite 18 | 19 | */ -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | Setup 3 | *.pyc 4 | *~ 5 | build 6 | prebuilt-x?? 7 | docs/\.buildinfo 8 | docs/objects.inv 9 | docs/doctrees/* 10 | docs/_sources 11 | docs/_static 12 | docs/_images 13 | docs/genindex.html 14 | docs/search.html 15 | docs/searchindex.js 16 | docs/tut/newbieguide.html 17 | docs/filepaths.html 18 | docs/index.html 19 | docs/ref/*.html 20 | docs/tut/SpriteIntro.html 21 | lib/version.py 22 | envdev* 23 | .virtualenv* 24 | manylinux-build/wheelhouse/ 25 | anenv 26 | dist 27 | .vagrant 28 | *.egg-info/ 29 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #fake Makefile for pygame, to support the common 2 | # ./configure;make;make install 3 | 4 | PYTHON = python 5 | 6 | build: Setup setup.py 7 | $(PYTHON) setup.py build 8 | 9 | install: Setup setup.py 10 | $(PYTHON) setup.py install 11 | 12 | Setup: 13 | $(PYTHON) configure.py 14 | 15 | check tests: 16 | $(PYTHON) run_tests.py 17 | 18 | test: build test src 19 | $(PYTHON) run_tests.py 20 | 21 | docs: 22 | $(PYTHON) makeref.py 23 | 24 | clean: 25 | rm -rf build dist 26 | rm -f lib/*~ src/*~ test/*~ 27 | 28 | -------------------------------------------------------------------------------- /examples/macosx/aliens_app_example/README.txt: -------------------------------------------------------------------------------- 1 | ********************************************************************* 2 | THESE INSTRUCTIONS ARE ONLY FOR MAC OS X 10.3, AND WILL ONLY CREATE 3 | STANDALONE BUNDLES FOR MAC OS X 10.3. THERE IS NO SUPPORT FOR 4 | MAC OS X 10.2. 5 | 6 | Also works on 10.4 and 10.5 7 | ********************************************************************* 8 | 9 | 10 | Install py2app and its dependencies. 11 | 12 | easy_install py2app 13 | 14 | 15 | 16 | To create the bundle: 17 | python setup.py py2app 18 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/ogg/build-ogg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | cd $(dirname `readlink -f "$0"`) 5 | 6 | OGG=libogg-1.3.2 7 | VORBIS=libvorbis-1.3.5 8 | 9 | curl -sL http://downloads.xiph.org/releases/ogg/${OGG}.tar.gz > ${OGG}.tar.gz 10 | curl -sL http://downloads.xiph.org/releases/vorbis/${VORBIS}.tar.gz > ${VORBIS}.tar.gz 11 | sha512sum -c ogg.sha512 12 | 13 | tar xzf ${OGG}.tar.gz 14 | cd $OGG 15 | ./configure 16 | make 17 | make install 18 | cd .. 19 | 20 | tar xzf ${VORBIS}.tar.gz 21 | cd $VORBIS 22 | ./configure 23 | make 24 | make install 25 | cd .. 26 | -------------------------------------------------------------------------------- /test/test_utils/endian.py: -------------------------------------------------------------------------------- 1 | # Module pygame.tests.test_utils.endian 2 | # 3 | # Machine independent conversion to little-endian and big-endian Python 4 | # integer values. 5 | 6 | import struct 7 | 8 | def little_endian_uint32(i): 9 | """Return the 32 bit unsigned integer little-endian representation of i""" 10 | 11 | s = struct.pack('I', i) 18 | return struct.unpack('=I', s)[0] 19 | -------------------------------------------------------------------------------- /.travis_osx_install.sh: -------------------------------------------------------------------------------- 1 | 2 | # ls -la /usr/local/lib/ 3 | # ls -la /usr/local/include/ 4 | # cat Setup 5 | # otool -L `find . -name imageext.so` 6 | # otool -L `find . -name image.so` 7 | # otool -L /usr/local/opt/sdl_image/lib/libSDL_image-1.2.0.dylib 8 | 9 | 10 | # Removes any X11R6 stuff so that png headers are not picked up by accident. 11 | sed 's/-I\/usr\/X11R6\/include //g' Setup > Setup.new 12 | mv Setup.new Setup 13 | 14 | # Makes for i386 and x86_64. 15 | CXXFLAGS="-arch i386 -arch x86_64" CFLAGS="-arch i386 -arch x86_64" LDFLAGS="-arch i386 -arch x86_64" $PYTHON_EXE setup.py install -noheaders 16 | -------------------------------------------------------------------------------- /test/util/build_page/libs/pywebsite/zdb.py: -------------------------------------------------------------------------------- 1 | from ZODB import DB, FileStorage 2 | import transaction 3 | 4 | class ZDB(object): 5 | def __init__(self, path): 6 | self.storage = FileStorage.FileStorage(path) 7 | self.db = DB(self.storage) 8 | self.connection = self.db.open() 9 | self.root = self.connection.root() 10 | 11 | def commit(self): 12 | transaction.commit() 13 | 14 | def close(self, commit=True): 15 | if commit: self.commit() 16 | self.connection.close() 17 | self.db.close() 18 | self.storage.close() 19 | 20 | __all__ = ['ZDB'] -------------------------------------------------------------------------------- /.travis_osx_after_success.sh: -------------------------------------------------------------------------------- 1 | if [[ ${BUILD_UNIVERSAL} == "1" ]]; then 2 | export CXXFLAGS="-arch i386 -arch x86_64" CFLAGS="-arch i386 -arch x86_64" LDFLAGS="-arch i386 -arch x86_64" 3 | echo "Set flags for universal build" 4 | echo $CFLAGS 5 | fi 6 | 7 | echo "Building wheel..." 8 | $PYTHON_EXE setup.py bdist_wheel 9 | 10 | # This copies in the .dylib files that are linked to the .so files. 11 | # It also rewrites the .so file linking options. https://pypi.python.org/pypi/delocate 12 | delocate-wheel -v dist/*.whl 13 | 14 | $PYTHON_EXE .travis_osx_rename_whl.py 15 | 16 | $PYTHON_EXE .travis_osx_upload_whl.py --no-config 17 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/sdl_libs/sdl.sha512: -------------------------------------------------------------------------------- 1 | ac392d916e6953b0925a7cbb0f232affea33339ef69b47a0a7898492afb9784b93138986df53d6da6d3e2ad79af1e9482df565ecca30f89428be0ae6851b1adc SDL-1.2.15.tar.gz 2 | 0e71b280abc2a7f15755e4480a3c1b52d41f9f8b0c9216a6f5bd9fc0e939456fb5d6c10419e1d1904785783f9a1891ead278c03e88b0466fecc6871c3ca40136 SDL_image-1.2.12.tar.gz 3 | 230f6c5a73f4bea364f8aa3d75f76694305571dea45f357def742b2b50849b2d896af71e08689981207edc99a9836088bee2d0bd98d92c7f4ca52b12b3d8cf96 SDL_mixer-1.2.12.tar.gz 4 | 64e04d1cd77e525e0f2413ad928841e5d3d09d551c030fc577b50777116580e430cb272b2aeb6191dfcc464669cf2f7a5a50d10e7c75637a3b1e8c8fca7fc78b SDL_ttf-2.0.11.tar.gz 5 | -------------------------------------------------------------------------------- /configtest/readme.txt: -------------------------------------------------------------------------------- 1 | The unit tests for the Windows configuration scripts. 2 | 3 | These must be run from their containing directory. That directory 4 | must be a subdirectory of the python scripts they test. 5 | 6 | test_congif_msys.py: 7 | Test dependency search. Requires testdir directory. 8 | 9 | test_config_win.py 10 | Test dependency search. Requires testdir directroy. 11 | 12 | test_dll.py 13 | Test the shared DLL information. 14 | 15 | test_msys.py 16 | Test the MSYS support module. Verifies that path name converion 17 | and MSYS bash shell can be calls. Requires MSYS to be installed 18 | and configured for MinGW. 19 | 20 | -------------------------------------------------------------------------------- /lib/gp2x/constants.py: -------------------------------------------------------------------------------- 1 | 2 | # GP2X joystick button mappings 3 | BUTTON_UP = (0) 4 | BUTTON_DOWN = (4) 5 | BUTTON_LEFT = (2) 6 | BUTTON_RIGHT = (6) 7 | BUTTON_UPLEFT = (1) 8 | BUTTON_UPRIGHT = (7) 9 | BUTTON_DOWNLEFT = (3) 10 | BUTTON_DOWNRIGHT = (5) 11 | BUTTON_CLICK = (18) 12 | BUTTON_A = (12) 13 | BUTTON_B = (13) 14 | BUTTON_X = (14) 15 | BUTTON_Y = (15) 16 | BUTTON_L = (10) 17 | BUTTON_R = (11) 18 | BUTTON_START = (8) 19 | BUTTON_SELECT = (9) 20 | BUTTON_VOLUP = (16) 21 | BUTTON_VOLDOWN = (17) 22 | -------------------------------------------------------------------------------- /lib/gp2x/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | # this lets me know that the module has not been imported. 4 | # we store it so we don't reimport a module each time the isgp2x function is called. 5 | _is_gp2x = -1 6 | 7 | def isgp2x(): 8 | """ Returns True if we are running on a gp2x, else False 9 | """ 10 | 11 | if _is_gp2x == -1: 12 | #TODO: FIXME: HACK: need to find a good way to do this. 13 | # Use configure to put 'gp2x' in the version string? 14 | import sys 15 | 16 | if "arm" in sys.version: 17 | _is_gp2x = True 18 | else: 19 | _is_gp2x = False 20 | else: 21 | return _is_gp2x 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/macosx/aliens_app_example/English.lproj/MainMenu.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 269 494 356 240 0 0 1600 1002 7 | IBEditorPositions 8 | 9 | 29 10 | 125 344 278 44 0 0 1600 1002 11 | 12 | IBFramework Version 13 | 349.0 14 | IBOpenObjects 15 | 16 | 29 17 | 18 | IBSystem Version 19 | 7D24 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/camera_test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | if __name__ == '__main__': 4 | import sys 5 | import os 6 | pkg_dir = os.path.split(os.path.abspath(__file__))[0] 7 | parent_dir, pkg_name = os.path.split(pkg_dir) 8 | is_pygame_pkg = (pkg_name == 'tests' and 9 | os.path.split(parent_dir)[1] == 'pygame') 10 | if not is_pygame_pkg: 11 | sys.path.insert(0, parent_dir) 12 | else: 13 | is_pygame_pkg = __name__.startswith('pygame.tests.') 14 | 15 | import pygame 16 | from pygame.compat import long_ 17 | import math 18 | 19 | #################################### Tests ##################################### 20 | 21 | class CameraModuleTest(unittest.TestCase): 22 | pass 23 | 24 | -------------------------------------------------------------------------------- /src/mask.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "bitmask.h" 3 | 4 | #define PYGAMEAPI_MASK_FIRSTSLOT 0 5 | #define PYGAMEAPI_MASK_NUMSLOTS 1 6 | #define PYGAMEAPI_LOCAL_ENTRY "_PYGAME_C_API" 7 | 8 | typedef struct { 9 | PyObject_HEAD 10 | bitmask_t *mask; 11 | } PyMaskObject; 12 | 13 | #define PyMask_AsBitmap(x) (((PyMaskObject*)x)->mask) 14 | 15 | #ifndef PYGAMEAPI_MASK_INTERNAL 16 | 17 | #define PyMask_Type (*(PyTypeObject*)PyMASK_C_API[0]) 18 | #define PyMask_Check(x) ((x)->ob_type == &PyMask_Type) 19 | 20 | #define import_pygame_mask() \ 21 | _IMPORT_PYGAME_MODULE(mask, MASK, PyMASK_C_API) 22 | 23 | static void* PyMASK_C_API[PYGAMEAPI_MASK_NUMSLOTS] = {NULL}; 24 | #endif /* #ifndef PYGAMEAPI_MASK_INTERNAL */ 25 | 26 | -------------------------------------------------------------------------------- /examples/macosx/aliens_app_example/setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | Script for building the example. 3 | 4 | Usage: 5 | python setup.py py2app 6 | """ 7 | from distutils.core import setup 8 | import py2app 9 | 10 | NAME = 'aliens' 11 | VERSION = '0.1' 12 | 13 | plist = dict( 14 | CFBundleIconFile=NAME, 15 | CFBundleName=NAME, 16 | CFBundleShortVersionString=VERSION, 17 | CFBundleGetInfoString=' '.join([NAME, VERSION]), 18 | CFBundleExecutable=NAME, 19 | CFBundleIdentifier='org.pygame.examples.aliens', 20 | ) 21 | 22 | setup( 23 | data_files=['English.lproj', '../../data'], 24 | app=[ 25 | #dict(script="aliens_bootstrap.py", plist=plist), 26 | dict(script="aliens.py", plist=plist), 27 | ], 28 | ) 29 | -------------------------------------------------------------------------------- /makeref.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sphinx 4 | 5 | import sys 6 | import os 7 | 8 | 9 | rst_dir = 'docs' 10 | rst_source_dir = os.path.join(rst_dir, 'reST') 11 | rst_build_dir = rst_dir 12 | rst_doctree_dir = os.path.join(rst_build_dir, 'doctrees') 13 | html_dir = 'docs' 14 | c_header_dir = os.path.join('src', 'doc') 15 | 16 | def Run(): 17 | return sphinx.main([sys.argv[0], 18 | '-b', 'html', 19 | '-d', rst_doctree_dir, 20 | '-D', 'headers_dest=%s' % (c_header_dir,), 21 | '-D', 'headers_mkdirs=0', 22 | rst_source_dir, 23 | html_dir,]) 24 | 25 | if __name__ == '__main__': 26 | sys.exit(Run()) 27 | -------------------------------------------------------------------------------- /test/run_tests__tests/all_ok/zero_tests_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | pass 20 | 21 | if __name__ == '__main__': 22 | unittest.main() 23 | -------------------------------------------------------------------------------- /symbian/SConscript.Ogg.py: -------------------------------------------------------------------------------- 1 | Import("*") 2 | 3 | # This file is generated with mmp2sconscript 4 | from scons_symbian import * 5 | 6 | target = "ogg" 7 | targettype = "lib" 8 | libraries = [] 9 | # Static libs 10 | libraries += [] 11 | 12 | uid3 = 0 13 | sources = ['deps/ogg/src/bitwise.c', 'deps/ogg/src/framing.c'] 14 | 15 | includes = ['/SDLS60/symbian'] 16 | sysincludes = [ EPOC32_INCLUDE, C_INCLUDE, 'deps/ogg/include'] 17 | defines = [] 18 | 19 | SymbianProgram( target, targettype, 20 | sources = sources, 21 | includes = includes, 22 | sysincludes = sysincludes, 23 | libraries = libraries, 24 | defines = defines, 25 | epocstacksize = 8192, 26 | epocheapsize = (0x400,0x100000), 27 | uid3 = uid3, 28 | ) 29 | 30 | -------------------------------------------------------------------------------- /docs/__main__.py: -------------------------------------------------------------------------------- 1 | # python -m pygame.docs 2 | 3 | import os 4 | import webbrowser 5 | try: 6 | from urllib.parse import urlunparse, quote 7 | except ImportError: 8 | from urlparse import urlunparse 9 | from urllib import quote 10 | 11 | def iterpath(path): 12 | path, last = os.path.split(path) 13 | if last: 14 | for p in iterpath(path): 15 | yield p 16 | yield last 17 | 18 | pkg_dir = os.path.dirname(os.path.abspath(__file__)) 19 | main_page = os.path.join(pkg_dir, 'index.html') 20 | url_path = quote('/'.join(iterpath(main_page))) 21 | drive, rest = os.path.splitdrive(__file__) 22 | if drive: 23 | url_path = "%s/%s" % (drive, url_path) 24 | url = urlunparse(('file', '', url_path, '', '', '')) 25 | webbrowser.open(url) 26 | -------------------------------------------------------------------------------- /mingwcfg.py: -------------------------------------------------------------------------------- 1 | # module mingwcfg.py 2 | 3 | """Manage the MinGW configuration file for setup.py""" 4 | 5 | import os 6 | import sys 7 | 8 | if sys.version_info >= (3,): 9 | import functools 10 | open_ = functools.partial(open, encoding='utf-8') 11 | else: 12 | open_ = open 13 | 14 | directory = os.path.abspath(os.path.split(__file__)[0]) 15 | path = os.path.join(directory, 'mingw.cfg') 16 | 17 | def write(mingw_root): 18 | cnf = open_(path, 'w') 19 | try: 20 | cnf.write(os.path.abspath(mingw_root)) 21 | cnf.write('\n') 22 | finally: 23 | cnf.close() 24 | 25 | def read(): 26 | cnf = open_(path, 'r') 27 | try: 28 | for ln in cnf: 29 | return ln.strip() 30 | finally: 31 | cnf.close() 32 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/upload_results.py: -------------------------------------------------------------------------------- 1 | import multi_part 2 | import urllib2 3 | import base64 4 | 5 | def post_build(results_zip, url=None): 6 | print 'POSTING BUILD, PLEASE WAIT' 7 | 8 | auth = tuple(open('./config/auth.txt').read().split(':')) 9 | 10 | theurl = url or 'http://pygame-testify.net/upload_results/index.py' 11 | 12 | req = urllib2.Request(theurl) 13 | 14 | base64string = base64.encodestring('%s:%s' % auth)[:-1] 15 | authheader = "Basic %s" % base64string 16 | 17 | req.add_header("Authorization", authheader) 18 | 19 | opener = urllib2.build_opener(multi_part.MultipartPostHandler) 20 | params = { "results_file" : open(results_zip, "rb") } 21 | 22 | return opener.open(req, params).read() 23 | 24 | if __name__ == '__main__': 25 | print post_build ('output/build.zip') -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/config/build_config.template: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | python_path=C:/Python25/python.exe 3 | 4 | ; Added to the default build_cmd (set in buildpage\config.py) 5 | extra_build_flags=--compiler=mingw32 6 | 7 | ; Added to the default test_cmd (set in buildpage\config.py) 8 | extra_test_flags=-s 9 | 10 | ; Sent to trunk\config.py as answers to questions (Y|N) 11 | ; eg Y\nY\nY\n translates to Y, Enter, Y, Enter, Y, Enter 12 | config_py_interaction = N\nN\nY\nY\n 13 | 14 | ; Determines which installer setup.py will make 15 | make_package=bdist_wininst 16 | package_mask=*.exe 17 | 18 | ; TODO: 19 | test_dir_subpath=Lib/site-packages 20 | 21 | [build_env] 22 | ; Anything in this will (be merged with | overide) os.environ 23 | ; Can use string interpolation %(var)s from [DEFAULT] 24 | 25 | ; PYTHONPATH= 26 | ; PATH= 27 | ; TMP= -------------------------------------------------------------------------------- /setmods: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script sets the unix file modes for pygame files. Specifically it 4 | # sets the executabled bit for any python files starting with the 5 | # '#!/usr/bin/env python' sha-bang. Searching is restricted to the base 6 | # and examples directories. The Pygame policy is to not preserve 7 | # executable mode in SVN. It is left as an end-user choice. It is safe to 8 | # commit executable files as their modes are not copied to SVN. 9 | # 10 | 11 | SHA_BANG='^#! */usr/bin/env python' 12 | PROGS="*.py examples/*.py" 13 | 14 | for name in `grep -le "$SHA_BANG" $PROGS` 15 | do 16 | chmod a+x "$name" 17 | done 18 | 19 | # Also make sure none of the files in lib/ are executable... 20 | # like the font file which was in the 1.8.1release. 21 | chmod -x lib/*.ttf 22 | chmod -x lib/*.py 23 | chmod -x lib/threads/*.py 24 | chmod -x lib/gp2x/*.py 25 | 26 | 27 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/portmidi/build-portmidi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | cd /portmidi_build/ 5 | 6 | SRC_ZIP="portmidi-src-217.zip" 7 | 8 | curl -sL http://downloads.sourceforge.net/project/portmedia/portmidi/217/${SRC_ZIP} > ${SRC_ZIP} 9 | sha512sum -c portmidi.sha512 10 | unzip $SRC_ZIP 11 | 12 | if [ "$(uname -i)" = "x86_64" ]; then 13 | export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64 14 | JRE_LIB_DIR=amd64 15 | else 16 | export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk 17 | JRE_LIB_DIR=i386 18 | fi 19 | ls ${JAVA_HOME} 20 | ls ${JAVA_HOME}/jre 21 | ls ${JAVA_HOME}/jre/lib 22 | ls ${JAVA_HOME}/jre/lib/$JRE_LIB_DIR 23 | ls ${JAVA_HOME}/jre/lib/$JRE_LIB_DIR/server 24 | 25 | cd portmidi/ 26 | #cmake -DJAVA_JVM_LIBRARY=${JAVA_HOME}/jre/lib/${JRE_LIB_DIR}/server/libjvm.so . 27 | cmake -DCMAKE_BUILD_TYPE=Release . 28 | make 29 | make install 30 | -------------------------------------------------------------------------------- /lib/_dummybackend.py: -------------------------------------------------------------------------------- 1 | """dummy Movie class if all else fails """ 2 | class Movie: 3 | def __init__(self, filename, surface=None): 4 | self.filename=filename 5 | self.surface = surface 6 | self.process = None 7 | self.loops=0 8 | self.playing = False 9 | self.paused = False 10 | self._backend = "DUMMY" 11 | self.width=0 12 | self.height=0 13 | self.finished = 1 14 | def play(self, loops=0): 15 | self.playing= not self.playing 16 | 17 | def stop(self): 18 | self.playing=not self.playing 19 | self.paused =not self.paused 20 | 21 | def pause(self): 22 | self.paused=not self.paused 23 | 24 | def resize(self, w, h): 25 | self.width=w 26 | self.height=h 27 | 28 | def __repr__(self): 29 | return "(%s 0.0s)"%self.filename 30 | -------------------------------------------------------------------------------- /test/util/build_page/libs/build_client/config/build_py25_exe.template: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | python_path=C:/Python25/python.exe 3 | 4 | ; Added to the default build_cmd (set in buildpage\config.py) 5 | extra_build_flags=--compiler=mingw32 6 | 7 | ; Added to the default test_cmd (set in buildpage\config.py) 8 | extra_test_flags=-s -F ../../output/test_results_dict.txt 9 | 10 | ; Sent to trunk\config.py as answers to questions (Y|N) 11 | ; eg Y\nY\nY\n translates to Y, Enter, Y, Enter, Y, Enter 12 | config_py_interaction = N\nN\nY\nY\n 13 | 14 | ; Determines which installer setup.py will make 15 | make_package=bdist_wininst 16 | package_mask=*.exe 17 | 18 | ; TODO: 19 | test_dir_subpath=Lib/site-packages 20 | 21 | [build_env] 22 | ; Anything in this will (be merged with | overide) os.environ 23 | ; Can use string interpolation %(var)s from [DEFAULT] 24 | 25 | ; PYTHONPATH= 26 | ; PATH= 27 | ; TMP= -------------------------------------------------------------------------------- /src/doc/cursors_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMECURSORS "pygame module for cursor resources" 3 | 4 | #define DOC_PYGAMECURSORSCOMPILE "compile(strings, black='X', white='.', xor='o') -> data, mask\ncreate binary cursor data from simple strings" 5 | 6 | #define DOC_PYGAMECURSORSLOADXBM "load_xbm(cursorfile) -> cursor_args\nload_xbm(cursorfile, maskfile) -> cursor_args\nload cursor data from an xbm file" 7 | 8 | 9 | 10 | /* Docs in a comment... slightly easier to read. */ 11 | 12 | /* 13 | 14 | pygame.cursors 15 | pygame module for cursor resources 16 | 17 | pygame.cursors.compile 18 | compile(strings, black='X', white='.', xor='o') -> data, mask 19 | create binary cursor data from simple strings 20 | 21 | pygame.cursors.load_xbm 22 | load_xbm(cursorfile) -> cursor_args 23 | load_xbm(cursorfile, maskfile) -> cursor_args 24 | load cursor data from an xbm file 25 | 26 | */ -------------------------------------------------------------------------------- /manylinux-build/build-wheels.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | SUPPORTED_PYTHONS="cp27-cp27mu cp34-cp34m cp35-cp35m cp36-cp36m" 5 | 6 | export PORTMIDI_INC_PORTTIME=1 7 | 8 | # Compile wheels 9 | for PYVER in $SUPPORTED_PYTHONS; do 10 | rm -rf /io/Setup /io/build/ 11 | PYBIN="/opt/python/${PYVER}/bin" 12 | ${PYBIN}/pip wheel /io/ -w wheelhouse/ 13 | done 14 | 15 | # Bundle external shared libraries into the wheels 16 | for whl in wheelhouse/*.whl; do 17 | auditwheel repair $whl -w /io/manylinux-build/wheelhouse/ 18 | done 19 | 20 | # Dummy options for headless testing 21 | export SDL_AUDIODRIVER=disk 22 | export SDL_VIDEODRIVER=dummy 23 | 24 | # Install packages and test 25 | for PYVER in $SUPPORTED_PYTHONS; do 26 | PYBIN="/opt/python/${PYVER}/bin" 27 | ${PYBIN}/pip install pygame --no-index -f /io/manylinux-build/wheelhouse 28 | (cd $HOME; ${PYBIN}/python -m pygame.tests --exclude opengl,music) 29 | done 30 | -------------------------------------------------------------------------------- /test/run_tests__tests/timeout/sleep_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | import time 19 | 20 | class KeyModuleTest(unittest.TestCase): 21 | def test_get_focused(self): 22 | stop_time = time.time() + 10.0 23 | while time.time() < stop_time: 24 | time.sleep(1) 25 | self.assert_(True) 26 | 27 | if __name__ == '__main__': 28 | unittest.main() 29 | -------------------------------------------------------------------------------- /test/run_tests__tests/everything/sleep_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | import time 19 | 20 | class KeyModuleTest(unittest.TestCase): 21 | def test_get_focused(self): 22 | stop_time = time.time() + 10.0 23 | while time.time() < stop_time: 24 | time.sleep(1) 25 | self.assert_(True) 26 | 27 | if __name__ == '__main__': 28 | unittest.main() 29 | -------------------------------------------------------------------------------- /src/_camera.h: -------------------------------------------------------------------------------- 1 | /* 2 | pygame - Python Game Library 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this library; if not, write to the Free 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | */ 19 | 20 | #ifndef _CAMERA_H 21 | #define _CAMERA_H 22 | 23 | #include "_pygame.h" 24 | #include "camera.h" 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /manylinux-build/Makefile: -------------------------------------------------------------------------------- 1 | REPO_ROOT = $(abspath ..) 2 | 3 | wheels-x64: 4 | docker run --rm -v ${REPO_ROOT}:/io pygame/manylinux1_base_x86_64 /io/manylinux-build/build-wheels.sh 5 | 6 | wheels-x86: 7 | docker run --rm -v ${REPO_ROOT}:/io pygame/manylinux1_base_i686 /io/manylinux-build/build-wheels.sh 8 | 9 | wheels: wheels-x64 wheels-x86 10 | 11 | base-image-x64: 12 | docker build -t pygame/manylinux1_base_x86_64 -f docker_base/Dockerfile-x86_64 docker_base 13 | 14 | base-image-x86: 15 | docker build -t pygame/manylinux1_base_i686 -f docker_base/Dockerfile-i686 docker_base 16 | 17 | base-images: base-image-x64 base-image-x86 18 | 19 | push-x64: 20 | docker push pygame/manylinux1_base_x86_64 21 | 22 | push-x86: 23 | docker push pygame/manylinux1_base_i686 24 | 25 | push: push-x64 push-x86 26 | 27 | pull-x64: 28 | docker pull pygame/manylinux1_base_x86_64 29 | 30 | pull-x86: 31 | docker pull pygame/manylinux1_base_i686 32 | 33 | pull: pull-x64 pull-x86 34 | -------------------------------------------------------------------------------- /docs/reST/ref/locals.rst: -------------------------------------------------------------------------------- 1 | .. include:: common.txt 2 | 3 | :mod:`pygame.locals` 4 | ==================== 5 | 6 | .. module:: pygame.locals 7 | :synopsis: pygame constants 8 | 9 | | :sl:`pygame constants` 10 | 11 | This module contains various constants used by Pygame. It's contents are 12 | automatically placed in the pygame module namespace. However, an application 13 | can use :mod:`pygame.locals` to include only the Pygame constants with a 'from 14 | :mod:`pygame.locals` import \*'. 15 | 16 | Detailed descriptions of the various constants are found throughout the Pygame 17 | documentation. :func:`pygame.display.set_mode` flags like ``HWSURFACE`` are 18 | found in the Display section. Event types are explained in the Event section. 19 | Keyboard ``K_`` constants relating to the key attribute of a ``KEYDOWN`` or 20 | ``KEYUP`` event are listed in the Key section. Also found there are the various 21 | ``MOD_`` key modifiers. Finally, ``TIMER_RESOLUTION`` is defined in Time. 22 | 23 | .. ## pygame.locals ## 24 | -------------------------------------------------------------------------------- /docs/reST/_static/tooltip.css: -------------------------------------------------------------------------------- 1 | /* Implement hyperlink tooltips 2 | * 3 | * Adapted from "Sexy Tooltips with Just CSS" 4 | * http://sixrevisions.com/css/css-only-tooltips/ 5 | */ 6 | 7 | .tooltip { 8 | cursor: help; text-decoration: none; 9 | position: relative; 10 | } 11 | 12 | .tooltip span.tooltip-content { 13 | margin-left: -999em; 14 | position: absolute; 15 | } 16 | 17 | .tooltip:hover span.tooltip-content { 18 | position: absolute; 19 | left: 1em; 20 | top: 2em; 21 | z-index: 99; 22 | margin-left: 0; 23 | } 24 | 25 | .tooltip:hover img { 26 | border: 0; 27 | margin: -10px 0 0 -55px; 28 | float: left; 29 | position: absolute; 30 | } 31 | 32 | .tooltip:hover em { 33 | font-family: Candara, Tahoma, Geneva, sans-serif; 34 | font-size: 1.2em; 35 | font-weight: bold; 36 | display: block; 37 | padding: 0.2em 0 0.6em 0; 38 | } 39 | 40 | .classic { padding: 0.8em 1em; } 41 | 42 | .custom { padding: 0.5em 0.8em 0.8em 2em; } 43 | 44 | * html a:hover { background: transparent; } 45 | -------------------------------------------------------------------------------- /symbian/SConscript.libpng.py: -------------------------------------------------------------------------------- 1 | """ Defines project for PNG library """ 2 | 3 | Import("*") 4 | 5 | # This file is generated with mmp2sconscript 6 | from scons_symbian import * 7 | from glob import glob 8 | 9 | Import("TARGET_NAME UID3 PACKAGE_NAME") 10 | 11 | # Built as dll because needed by SDL and the application 12 | target = TARGET_NAME 13 | targettype = TARGETTYPE_LIB 14 | libraries = C_LIBRARY + ['euser'] 15 | 16 | # Static libs 17 | libraries += [] 18 | 19 | #uid3 = UID3 20 | 21 | sources = glob( "deps/libpng/png*.c") 22 | [ sources.remove(x) for x in glob("deps/libpng/pngtes*.c")] 23 | 24 | 25 | includes = ['deps/libpng/'] 26 | sysincludes = ['/epoc32/include', C_INCLUDE ] 27 | defines = [] 28 | 29 | SymbianProgram( target, targettype, 30 | sources = sources, 31 | includes = includes, 32 | sysincludes = sysincludes, 33 | libraries = libraries, 34 | defines = defines, 35 | #uid3 = uid3, 36 | package = PACKAGE_NAME, 37 | ) 38 | 39 | -------------------------------------------------------------------------------- /test/ftfont_test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | if __name__ == '__main__': 4 | pkg_dir = os.path.split(os.path.abspath(__file__))[0] 5 | parent_dir, pkg_name = os.path.split(pkg_dir) 6 | is_pygame_pkg = (pkg_name == 'tests' and 7 | os.path.split(parent_dir)[1] == 'pygame') 8 | if not is_pygame_pkg: 9 | sys.path.insert(0, parent_dir) 10 | else: 11 | is_pygame_pkg = __name__.startswith('pygame.tests.') 12 | 13 | import unittest 14 | if is_pygame_pkg: 15 | from pygame.tests import font_test 16 | else: 17 | from test import font_test 18 | 19 | import pygame.ftfont 20 | 21 | font_test.pygame_font = pygame.ftfont 22 | # Disable UCS-4 specific tests as this "Font" type does accept UCS-4 codes. 23 | font_test.UCS_4 = False 24 | 25 | for name in dir(font_test): 26 | obj = getattr(font_test, name) 27 | if (isinstance(obj, type) and # conditional and 28 | issubclass(obj, unittest.TestCase)): 29 | globals()[name] = obj 30 | 31 | if __name__ == '__main__': 32 | unittest.main() 33 | -------------------------------------------------------------------------------- /examples/aacircle.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """Proof of concept gfxdraw example""" 4 | 5 | import pygame 6 | import pygame.gfxdraw 7 | 8 | def main(): 9 | pygame.init() 10 | screen = pygame.display.set_mode((500,500)) 11 | screen.fill((255, 0, 0)) 12 | s = pygame.Surface(screen.get_size(), pygame.SRCALPHA, 32) 13 | pygame.draw.line(s, (0,0,0), (250, 250), (250+200,250)) 14 | 15 | width = 1 16 | for a_radius in range(width): 17 | radius = 200 18 | pygame.gfxdraw.aacircle(s, 250, 250, radius-a_radius, (0, 0, 0)) 19 | 20 | screen.blit(s, (0, 0)) 21 | pygame.display.flip() 22 | try: 23 | while 1: 24 | event = pygame.event.wait() 25 | if event.type == pygame.QUIT: 26 | break 27 | if event.type == pygame.KEYDOWN: 28 | if event.key == pygame.K_ESCAPE or event.unicode == 'q': 29 | break 30 | pygame.display.flip() 31 | finally: 32 | pygame.quit() 33 | 34 | if __name__ == '__main__': 35 | main() 36 | -------------------------------------------------------------------------------- /src/_surface.h: -------------------------------------------------------------------------------- 1 | /* 2 | pygame - Python Game Library 3 | Copyright (C) 2000-2001 Pete Shinners 4 | Copyright (C) 2007 Marcus von Appen 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | Pete Shinners 21 | pete@shinners.org 22 | */ 23 | 24 | #ifndef _SURFACE_H 25 | #define _SURFACE_H 26 | 27 | #include "_pygame.h" 28 | #include "surface.h" 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /lib/macosx.py: -------------------------------------------------------------------------------- 1 | import os, sys 2 | 3 | try: 4 | import MacOS 5 | except: 6 | MacOS = None 7 | 8 | from pygame.pkgdata import getResource 9 | 10 | from pygame import sdlmain_osx 11 | 12 | __all__ = ['Video_AutoInit'] 13 | 14 | def Video_AutoInit(): 15 | """This is a function that's called from the c extension code 16 | just before the display module is initialized""" 17 | if MacOS and not MacOS.WMAvailable(): 18 | if not sdlmain_osx.WMEnable(): 19 | raise ImportError("Can not access the window manager. Use py2app or execute with the pythonw script.") 20 | if not sdlmain_osx.RunningFromBundleWithNSApplication(): 21 | try: 22 | default_icon_data = getResource('pygame_icon.tiff').read() 23 | except IOError: 24 | default_icon_data = None 25 | except NotImplementedError: 26 | default_icon_data = None 27 | 28 | sdlmain_osx.InstallNSApplication(default_icon_data) 29 | if (os.getcwd() == '/') and len(sys.argv) > 1: 30 | os.chdir(os.path.dirname(sys.argv[0])) 31 | return True 32 | -------------------------------------------------------------------------------- /src/doc/overlay_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMEOVERLAY "Overlay(format, (width, height)) -> Overlay\npygame object for video overlay graphics" 3 | 4 | #define DOC_OVERLAYDISPLAY "display((y, u, v)) -> None\ndisplay() -> None\nset the overlay pixel data" 5 | 6 | #define DOC_OVERLAYSETLOCATION "set_location(rect) -> None\ncontrol where the overlay is displayed" 7 | 8 | #define DOC_OVERLAYGETHARDWARE "get_hardware(rect) -> int\ntest if the Overlay is hardware accelerated" 9 | 10 | 11 | 12 | /* Docs in a comment... slightly easier to read. */ 13 | 14 | /* 15 | 16 | pygame.Overlay 17 | Overlay(format, (width, height)) -> Overlay 18 | pygame object for video overlay graphics 19 | 20 | pygame.Overlay.display 21 | display((y, u, v)) -> None 22 | display() -> None 23 | set the overlay pixel data 24 | 25 | pygame.Overlay.set_location 26 | set_location(rect) -> None 27 | control where the overlay is displayed 28 | 29 | pygame.Overlay.get_hardware 30 | get_hardware(rect) -> int 31 | test if the Overlay is hardware accelerated 32 | 33 | */ -------------------------------------------------------------------------------- /test/run_tests__tests/all_ok/no_assertions__ret_code_of_1__test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | pass 21 | 22 | def test_get_mods(self): 23 | pass 24 | 25 | def test_get_pressed(self): 26 | pass 27 | 28 | def test_name(self): 29 | pass 30 | 31 | def test_set_mods(self): 32 | pass 33 | 34 | def test_set_repeat(self): 35 | pass 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /docs/reST/filepaths.rst: -------------------------------------------------------------------------------- 1 | File Path Function Arguments 2 | ============================ 3 | 4 | File Path Function Arguments 5 | ---------------------------- 6 | 7 | A Pygame function or method which takes a file path argument 8 | will accept either an Unicode or a byte — 8-bit or ASCII character — string. 9 | Unicode strings are translated to Python's default file system encoding, 10 | as returned by sys.getfilesystemencoding(). 11 | An Unicode code point above U+FFFF — '\uFFFF' — can 12 | be coded directly with a 32-bit escape 13 | sequences — '\Uxxxxxxxx' — , 14 | even for Python interpreters built with an UCS-2 (16-bit character) unicode type. 15 | Byte strings are passed to the operating system unchanged. 16 | 17 | Null characters — '\x00' —  18 | are not permitted in the path, raising an exception. 19 | An exception is also raised if an Unicode file path cannot be encoded. 20 | How UTF-16 surrogate codes are handled is Python interpreter dependent. 21 | Use UTF-32 code points and 32-bit escape sequences instead. 22 | The exception types are function dependent. 23 | -------------------------------------------------------------------------------- /test/run_tests__tests/exclude/magic_tag_test.py: -------------------------------------------------------------------------------- 1 | __tags__ = ['magic'] 2 | 3 | if __name__ == '__main__': 4 | import sys 5 | import os 6 | pkg_dir = (os.path.split( 7 | os.path.split( 8 | os.path.split( 9 | os.path.abspath(__file__))[0])[0])[0]) 10 | parent_dir, pkg_name = os.path.split(pkg_dir) 11 | is_pygame_pkg = (pkg_name == 'tests' and 12 | os.path.split(parent_dir)[1] == 'pygame') 13 | if not is_pygame_pkg: 14 | sys.path.insert(0, parent_dir) 15 | else: 16 | is_pygame_pkg = __name__.startswith('pygame.tests.') 17 | 18 | import unittest 19 | 20 | class KeyModuleTest(unittest.TestCase): 21 | def test_get_focused(self): 22 | self.assert_(True) 23 | 24 | def test_get_mods(self): 25 | self.assert_(True) 26 | 27 | def test_get_pressed(self): 28 | self.assert_(True) 29 | 30 | def test_name(self): 31 | self.assert_(True) 32 | 33 | def test_set_mods(self): 34 | self.assert_(True) 35 | 36 | if __name__ == '__main__': 37 | unittest.main() 38 | -------------------------------------------------------------------------------- /test/run_tests__tests/everything/magic_tag_test.py: -------------------------------------------------------------------------------- 1 | __tags__ = ['magic'] 2 | 3 | if __name__ == '__main__': 4 | import sys 5 | import os 6 | pkg_dir = (os.path.split( 7 | os.path.split( 8 | os.path.split( 9 | os.path.abspath(__file__))[0])[0])[0]) 10 | parent_dir, pkg_name = os.path.split(pkg_dir) 11 | is_pygame_pkg = (pkg_name == 'tests' and 12 | os.path.split(parent_dir)[1] == 'pygame') 13 | if not is_pygame_pkg: 14 | sys.path.insert(0, parent_dir) 15 | else: 16 | is_pygame_pkg = __name__.startswith('pygame.tests.') 17 | 18 | import unittest 19 | 20 | class KeyModuleTest(unittest.TestCase): 21 | def test_get_focused(self): 22 | self.assert_(True) 23 | 24 | def test_get_mods(self): 25 | self.assert_(True) 26 | 27 | def test_get_pressed(self): 28 | self.assert_(True) 29 | 30 | def test_name(self): 31 | self.assert_(True) 32 | 33 | def test_set_mods(self): 34 | self.assert_(True) 35 | 36 | if __name__ == '__main__': 37 | unittest.main() 38 | -------------------------------------------------------------------------------- /test/run_tests__tests/incomplete/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def todo_test_get_pressed(self): 26 | self.fail() 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def todo_test_set_mods(self): 32 | self.fail() 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /symbian/changes_for_symbian.txt: -------------------------------------------------------------------------------- 1 | 2 | == Changes required to port pygame for Series 60 == 3 | 4 | This file is an attempt to keep track of what has been changed 5 | and why to make pygame reality on PyS60. 6 | 7 | 8 | == Changes for extension modules == 9 | 10 | The extension module names have been renamed. On PC the native extensions 11 | can be put under pygame directory, but on Symbian this is not possible. 12 | All native extensions must be placed under sys\bin directory. 13 | 14 | The extensions are built-in to a single library to avoid polluting the 15 | sys\bin directory with over 10 new dlls. The modules are set as built-in modules 16 | at application startup. 17 | 18 | The names of the extensions were changed to pygame_. A python wrappers 19 | are used( see symbian/lib ) to simply import all attributes of the native extension 20 | to keep the pygame API the same. 21 | 22 | To handle the pygame_ prefix, a new preprocessor definition MODPREFIX is defined 23 | in pygame.h. It is defined as empty string by default and set to "pygame_" for 24 | Symbian. 25 | 26 | Jussi Toivola 27 | "".join(reversed("moc.liamg@aloviotj")) -------------------------------------------------------------------------------- /test/run_tests__tests/all_ok/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/all_ok/fake_3_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/all_ok/fake_4_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/all_ok/fake_5_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/all_ok/fake_6_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/exclude/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/timeout/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /src/pgarrinter.h: -------------------------------------------------------------------------------- 1 | /* array structure interface version 3 declarations */ 2 | 3 | #if !defined(PG_ARRAYINTER_HEADER) 4 | #define PG_ARRAYINTER_HEADER 5 | 6 | static const int PAI_CONTIGUOUS = 0x01; 7 | static const int PAI_FORTRAN = 0x02; 8 | static const int PAI_ALIGNED = 0x100; 9 | static const int PAI_NOTSWAPPED = 0x200; 10 | static const int PAI_WRITEABLE = 0x400; 11 | static const int PAI_ARR_HAS_DESCR = 0x800; 12 | 13 | typedef struct { 14 | int two; /* contains the integer 2 -- simple sanity check */ 15 | int nd; /* number of dimensions */ 16 | char typekind; /* kind in array -- character code of typestr */ 17 | int itemsize; /* size of each element */ 18 | int flags; /* flags indicating how the data should be */ 19 | /* interpreted */ 20 | Py_intptr_t *shape; /* A length-nd array of shape information */ 21 | Py_intptr_t *strides; /* A length-nd array of stride information */ 22 | void *data; /* A pointer to the first element of the array */ 23 | PyObject *descr; /* NULL or a data-description */ 24 | } PyArrayInterface; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /test/run_tests__tests/everything/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/failures1/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/failures1/fake_3_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/incomplete/fake_3_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/infinite_loop/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/print_stderr/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/print_stdout/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/incomplete_todo/fake_3_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/incomplete_todo/fake_2_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def todo_test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def todo_test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/run_tests__tests/infinite_loop/fake_1_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | while True: 24 | pass 25 | 26 | def test_get_pressed(self): 27 | self.assert_(True) 28 | 29 | def test_name(self): 30 | self.assert_(True) 31 | 32 | def test_set_mods(self): 33 | self.assert_(True) 34 | 35 | def test_set_repeat(self): 36 | self.assert_(True) 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /symbian/pygame_pkgtemplate.txt: -------------------------------------------------------------------------------- 1 | ;Localised package name 2 | #{"{{appname}}"},({{uid}}),{{version[0]}},{{version[1]}},{{version[2]}} 3 | ;Localized vendor name 4 | %{"PyS60 Community"} 5 | 6 | ;Unique Vendor name 7 | :"Pys60 Community" 8 | 9 | [0x101F7961], 0, 0, 0, {"Series60ProductID"} 10 | 11 | {{script}} 12 | import os 13 | from scons_symbian.relpath import relpath 14 | 15 | installed = [] 16 | keys = files.keys();keys.sort() 17 | for x in keys: 18 | 19 | t = files[x] 20 | 21 | # Do split in platform independent way 22 | t = t.replace("\\","/").split( "/" ) 23 | if t[0] == "any": 24 | t[0] = "!:" 25 | else: 26 | t[0] = t[0] + ":" 27 | # Convert the slashes for pkg 28 | t = "\\".join( t ).replace( "/", "\\" ) 29 | 30 | x = relpath( os.getcwd(), x ) 31 | x = x.replace( "/", "\\" ) 32 | 33 | installed.append( '%-50s - "%s"' % ( '"%s"' % x, t ) ) 34 | 35 | installed = "\n".join(installed) 36 | {{endscript}} 37 | 38 | {{installed}} 39 | 40 | {{if EMBEDDED_PYTHON_SIS is not None:}} 41 | @"{{EMBEDDED_PYTHON_SIS}}",({{EMBEDDED_PYTHON_SIS_UID}}) 42 | {{endif}} -------------------------------------------------------------------------------- /test/run_tests__tests/everything/incomplete_todo_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def todo_test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def todo_test_set_mods(self): 32 | self.assert_(True) 33 | 34 | def test_set_repeat(self): 35 | self.assert_(True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /test/util/build_page/libs/process_results.py: -------------------------------------------------------------------------------- 1 | from __future__ import with_statement 2 | 3 | import os 4 | 5 | from pywebsite.escape import ehtml 6 | from helpers import relative_to, norm_le 7 | from build_client.helpers import create_zip 8 | 9 | def process_zip(rz, results_dir): 10 | ######################################################################## 11 | # Dump out results and installer for /index.php 12 | # 13 | 14 | installer_name = rz.installer 15 | 16 | txts = ('prebuilt', 'buildresults') 17 | for f in (f for f in txts if f in rz.namelist()): 18 | fname = relative_to(__file__, '../%s_%s.txt' % (f, rz.platform_id)) 19 | with open(fname, 'w') as fh: 20 | fh.write(rz.read(f)) 21 | 22 | if installer_name: 23 | with open(relative_to(__file__, '../%s' % installer_name), 'wb') as fh: 24 | fh.write(rz.read(installer_name)) 25 | 26 | ######################################################################## 27 | # Archive The Text 28 | # 29 | 30 | archive_zip = os.path.join ( 31 | results_dir, 'archives', '%s_%s.zip' % (rz.platform_id, rz.latest_rev) 32 | ) 33 | 34 | rz.archive_text(archive_zip) -------------------------------------------------------------------------------- /test/run_tests__tests/exclude/invisible_tag_test.py: -------------------------------------------------------------------------------- 1 | __tags__ = ['invisible'] 2 | 3 | if __name__ == '__main__': 4 | import sys 5 | import os 6 | pkg_dir = (os.path.split( 7 | os.path.split( 8 | os.path.split( 9 | os.path.abspath(__file__))[0])[0])[0]) 10 | parent_dir, pkg_name = os.path.split(pkg_dir) 11 | is_pygame_pkg = (pkg_name == 'tests' and 12 | os.path.split(parent_dir)[1] == 'pygame') 13 | if not is_pygame_pkg: 14 | sys.path.insert(0, parent_dir) 15 | else: 16 | is_pygame_pkg = __name__.startswith('pygame.tests.') 17 | 18 | import unittest 19 | 20 | class KeyModuleTest(unittest.TestCase): 21 | def test_get_focused(self): 22 | self.assert_(True) 23 | 24 | def test_get_mods(self): 25 | self.assert_(True) 26 | 27 | def test_get_pressed(self): 28 | self.assert_(True) 29 | 30 | def test_name(self): 31 | self.assert_(True) 32 | 33 | def test_set_mods(self): 34 | self.assert_(True) 35 | 36 | def test_set_repeat(self): 37 | self.assert_(True) 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /check_test.py: -------------------------------------------------------------------------------- 1 | # Program check_test.py 2 | # Requires Python 2.4 3 | 4 | """A program for listing the modules accessed by a Pygame unit test module 5 | 6 | Usage: 7 | 8 | python check_test.py 9 | 10 | e.g. 11 | 12 | python check_test.py surface_test.py 13 | 14 | The returned list will show which Pygame modules were imported and accessed. 15 | Each module name is followed by a list of attributes accessed. 16 | 17 | """ 18 | 19 | import sys 20 | import os 21 | import trackmod 22 | trackmod.begin(pattern=['pygame', 'pygame.*'], 23 | continuous=True, 24 | submodule_accesses=False) 25 | skip = set(['pygame.locals', 'pygame.constants', 26 | 'pygame.base', 'pygame.threads']) 27 | 28 | os.chdir('test') 29 | test_file = sys.argv[1] 30 | del sys.argv[1] 31 | try: 32 | execfile(test_file) 33 | finally: 34 | trackmod.end() 35 | print "=== Pygame package submodule accesses ===" 36 | print 37 | accesses = [(n, a) for n, a in trackmod.get_accesses().iteritems() 38 | if n not in skip] 39 | accesses.sort(key=lambda t: t[0]) 40 | for name, attributes in accesses: 41 | print "%s (%s)" % (name, ', '.join(attributes)) 42 | -------------------------------------------------------------------------------- /bdist_mpkg_support.py: -------------------------------------------------------------------------------- 1 | # only enable bdist_mpkg if it's installed already 2 | import pkg_resources 3 | try: 4 | pkg_resources.require('bdist_mpkg>=0.4.2') 5 | except pkg_resources.DistributionNotFound: 6 | raise ImportError 7 | 8 | try: 9 | unicode 10 | except NameError: 11 | def unicode(s): 12 | return str(s) 13 | 14 | FRAMEWORKS = ['SDL', 'SDL_ttf', 'SDL_image', 'SDL_mixer'] 15 | 16 | CUSTOM_SCHEMES = dict( 17 | examples=dict( 18 | description=unicode('(Optional) pygame example code'), 19 | prefix=unicode('/Developer/Python/pygame/Examples'), 20 | source='examples', 21 | ), 22 | docs=dict( 23 | description=unicode('(Optional) pygame documentation'), 24 | prefix=unicode('/Developer/Python/pygame/Documentation'), 25 | source='docs', 26 | ), 27 | ) 28 | 29 | for framework in FRAMEWORKS: 30 | CUSTOM_SCHEMES[framework] = dict( 31 | description=unicode('(Required) %s.framework' % (framework,)), 32 | prefix=unicode('/Library/Frameworks/%s.framework' % (framework,)), 33 | source=unicode('/Library/Frameworks/%s.framework' % (framework,)), 34 | ) 35 | 36 | options = dict(bdist_mpkg=dict(custom_schemes=CUSTOM_SCHEMES)) 37 | -------------------------------------------------------------------------------- /lib/locals.py: -------------------------------------------------------------------------------- 1 | ## pygame - Python Game Library 2 | ## Copyright (C) 2000-2003 Pete Shinners 3 | ## 4 | ## This library is free software; you can redistribute it and/or 5 | ## modify it under the terms of the GNU Library General Public 6 | ## License as published by the Free Software Foundation; either 7 | ## version 2 of the License, or (at your option) any later version. 8 | ## 9 | ## This library is distributed in the hope that it will be useful, 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | ## Library General Public License for more details. 13 | ## 14 | ## You should have received a copy of the GNU Library General Public 15 | ## License along with this library; if not, write to the Free 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | ## 18 | ## Pete Shinners 19 | ## pete@shinners.org 20 | 21 | 22 | 23 | """Set of functions from PyGame that are handy to have in 24 | the local namespace for your module""" 25 | 26 | from pygame.constants import * 27 | from pygame.rect import Rect 28 | import pygame.color as color 29 | Color = color.Color 30 | 31 | -------------------------------------------------------------------------------- /test/run_tests__tests/failures1/fake_4_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(False, "Some Jibberish") 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | if 1: 33 | if 1: 34 | assert False 35 | 36 | def test_set_repeat(self): 37 | self.assert_(True) 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/run_tests__tests/print_stderr/fake_3_test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | if __name__ == '__main__': 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(True) 27 | 28 | def test_name(self): 29 | sys.stderr.write("jibberish messes things up\n") 30 | self.assert_(False) 31 | 32 | def test_set_mods(self): 33 | self.assert_(True) 34 | 35 | def test_set_repeat(self): 36 | self.assert_(True) 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/run_tests__tests/print_stderr/fake_4_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(False, "Some Jibberish") 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | if 1: 33 | if 1: 34 | assert False 35 | 36 | def test_set_repeat(self): 37 | self.assert_(True) 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/run_tests__tests/print_stdout/fake_4_test.py: -------------------------------------------------------------------------------- 1 | if __name__ == '__main__': 2 | import sys 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | self.assert_(False, "Some Jibberish") 27 | 28 | def test_name(self): 29 | self.assert_(True) 30 | 31 | def test_set_mods(self): 32 | if 1: 33 | if 1: 34 | assert False 35 | 36 | def test_set_repeat(self): 37 | self.assert_(True) 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /setup_win_common.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | 3 | # module setup_win_common.py 4 | 5 | """A module for reading the information common to all Windows setups. 6 | 7 | Exports read and get_definitions. 8 | """ 9 | 10 | path = 'Setup_Win_Common.in' 11 | 12 | class Definition(object): 13 | def __init__(self, name, value): 14 | self.name = name 15 | self.value = value 16 | 17 | def read(): 18 | """Return the contents of the Windows Common Setup as a string""" 19 | 20 | setup_in = open(path) 21 | try: 22 | return setup_in.read() 23 | finally: 24 | setup_in.close() 25 | 26 | def get_definitions(): 27 | """Return a list of definitions in the Windows Common Setup 28 | 29 | Each macro definition object has a 'name' and 'value' attribute. 30 | """ 31 | import re 32 | 33 | setup_in = open(path) 34 | try: 35 | deps = [] 36 | match = re.compile(r'([a-zA-Z0-9_]+) += +(.+)$').match 37 | for line in setup_in: 38 | m = match(line) 39 | if m is not None: 40 | deps.append(Definition(m.group(1), m.group(2))) 41 | return deps 42 | finally: 43 | setup_in.close() 44 | 45 | __all__= ['read', 'get_dependencies'] 46 | -------------------------------------------------------------------------------- /test/run_tests__tests/print_stdout/fake_3_test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | if __name__ == '__main__': 3 | import os 4 | pkg_dir = (os.path.split( 5 | os.path.split( 6 | os.path.split( 7 | os.path.abspath(__file__))[0])[0])[0]) 8 | parent_dir, pkg_name = os.path.split(pkg_dir) 9 | is_pygame_pkg = (pkg_name == 'tests' and 10 | os.path.split(parent_dir)[1] == 'pygame') 11 | if not is_pygame_pkg: 12 | sys.path.insert(0, parent_dir) 13 | else: 14 | is_pygame_pkg = __name__.startswith('pygame.tests.') 15 | 16 | import unittest 17 | 18 | class KeyModuleTest(unittest.TestCase): 19 | def test_get_focused(self): 20 | self.assert_(True) 21 | 22 | def test_get_mods(self): 23 | self.assert_(True) 24 | 25 | def test_get_pressed(self): 26 | sys.stdout.write("jibberish ruins everything\n") 27 | self.assert_(False) 28 | 29 | def test_name(self): 30 | sys.stdout.write("forgot to remove debug crap\n") 31 | self.assert_(True) 32 | 33 | def test_set_mods(self): 34 | self.assert_(True) 35 | 36 | def test_set_repeat(self): 37 | self.assert_(True) 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /docs/reST/_templates/header.h: -------------------------------------------------------------------------------- 1 | {#- Generate an extension module header file of doc strings #} 2 | 3 | {%- set classmembers = ['attribute', 'method', 'staticmethod', 'classmethod'] %} 4 | 5 | {%- macro cmacro(item) %} 6 | {%- if item['desctype'] in classmembers %} 7 | {%- set start_at = -2 %} 8 | {%- else %} 9 | {%- set start_at = 0 %} 10 | {%- endif %} 11 | {%- set name = item['fullname'] %} 12 | {{- 'DOC_' + name.split('.')[start_at:]|join('')|replace('_', '')|upper }} 13 | {%- endmacro %} 14 | 15 | {%- macro join_sigs(item) %} 16 | {%- set sigs = item['signatures'] %} 17 | {%- if sigs %} 18 | {{- sigs|join('\\n') + '\\n' }} 19 | {%- else %} 20 | {{- '' }} 21 | {%- endif %} 22 | {%- endmacro %} 23 | 24 | {#- -#} 25 | 26 | 27 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 28 | {% for item in hdr_items -%} 29 | #define {{ cmacro(item) }} "{{ join_sigs(item) }}{{ item['summary'] }}" 30 | 31 | {% endfor %} 32 | 33 | /* Docs in a comment... slightly easier to read. */ 34 | 35 | /* 36 | 37 | {% for item in hdr_items -%} 38 | {{ item['fullname'] }} 39 | {% set sigs = item['signatures'] -%} 40 | {% if sigs -%} 41 | {{ ' ' + sigs|join('\n ') }} 42 | {% endif -%} 43 | {{ item['summary'] }} 44 | 45 | {% endfor -%} 46 | */ 47 | -------------------------------------------------------------------------------- /docs/reST/themes/classic/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = pygame.css 4 | pygments_style = sphinx 5 | 6 | [options] 7 | home_uri = '' 8 | embedded = true 9 | nosidebar = true 10 | nofooter = true 11 | relbar = false 12 | noheader = false 13 | noheading = false 14 | notableofcontents = false 15 | 16 | footerbgcolor = #11303d 17 | footertextcolor = #000000 18 | sidebarbgcolor = #1c4e63 19 | sidebartextcolor = #ffffff 20 | sidebarlinkcolor = #98dbcc 21 | relbarbgcolor = #6aee28 22 | relbartextcolor = #000000 23 | relbarlinkcolor = #000000 24 | bgcolor = #aaeebb 25 | textcolor = #000000 26 | headbgcolor = #f2f2f2 27 | headtextcolor = #20435c 28 | headlinkcolor = #c60f0f 29 | linkcolor = #000000 30 | codebgcolor = #eeffcc 31 | codetextcolor = #333333 32 | headerbgcolor = #6aee28 33 | logobgcolor = #c2fc20 34 | tooltipbgcolor = #c2fc20 35 | tooltipbdrcolor = #ace01C 36 | 37 | headerborder = 3px solid black 38 | 39 | bodyfont = sans-serif 40 | headfont = sans-serif 41 | sigfont = monospace 42 | -------------------------------------------------------------------------------- /docs/reST/_static/reset.css: -------------------------------------------------------------------------------- 1 | /* Set browser to a known state to get around browser incompatibilities. 2 | * Copied from http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ 3 | */ 4 | html, body, div, span, applet, object, iframe, 5 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 6 | a, abbr, acronym, address, big, cite, code, 7 | del, dfn, em, font, img, ins, kbd, q, s, samp, 8 | small, strike, strong, sub, sup, tt, var, 9 | dl, dt, dd, ol, ul, li, 10 | fieldset, form, label, legend, 11 | table, caption, tbody, tfoot, thead, tr, th, td { 12 | margin: 0; 13 | padding: 0; 14 | border: 0; 15 | outline: 0; 16 | font-weight: inherit; 17 | font-style: inherit; 18 | font-size: 100%; 19 | font-family: inherit; 20 | vertical-align: baseline; 21 | } 22 | /* remember to define focus styles! */ 23 | :focus { 24 | outline: 0; 25 | } 26 | body { 27 | line-height: 1; 28 | color: black; 29 | background: white; 30 | } 31 | ol, ul { 32 | list-style: none; 33 | } 34 | /* tables still need 'cellspacing="0"' in the markup */ 35 | table { 36 | border-collapse: separate; 37 | border-spacing: 0; 38 | } 39 | caption, th, td { 40 | text-align: left; 41 | font-weight: normal; 42 | } 43 | blockquote:before, blockquote:after, 44 | q:before, q:after { 45 | content: ""; 46 | } 47 | blockquote, q { 48 | quotes: "" ""; 49 | } 50 | -------------------------------------------------------------------------------- /src/doc/bufferproxy_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMEBUFFERPROXY "BufferProxy() -> BufferProxy\npygame object to export a surface buffer through an array protocol" 3 | 4 | #define DOC_BUFFERPROXYPARENT "parent -> Surface\nparent -> \nReturn wrapped exporting object." 5 | 6 | #define DOC_BUFFERPROXYLENGTH "length -> int\nThe size, in bytes, of the exported buffer." 7 | 8 | #define DOC_BUFFERPROXYRAW "raw -> bytes\nA copy of the exported buffer as a single block of bytes." 9 | 10 | #define DOC_BUFFERPROXYWRITE "write(buffer, offset=0)\nWrite raw bytes to object buffer." 11 | 12 | 13 | 14 | /* Docs in a comment... slightly easier to read. */ 15 | 16 | /* 17 | 18 | pygame.BufferProxy 19 | BufferProxy() -> BufferProxy 20 | pygame object to export a surface buffer through an array protocol 21 | 22 | pygame.BufferProxy.parent 23 | parent -> Surface 24 | parent -> 25 | Return wrapped exporting object. 26 | 27 | pygame.BufferProxy.length 28 | length -> int 29 | The size, in bytes, of the exported buffer. 30 | 31 | pygame.BufferProxy.raw 32 | raw -> bytes 33 | A copy of the exported buffer as a single block of bytes. 34 | 35 | pygame.BufferProxy.write 36 | write(buffer, offset=0) 37 | Write raw bytes to object buffer. 38 | 39 | */ -------------------------------------------------------------------------------- /test/util/build_page/libs/pywebsite/escape.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | ################################################################################ 4 | 5 | import re 6 | import htmlentitydefs 7 | 8 | _escape_re = re.compile(eval(r'u"[&<>\"]|[\u0080-\uffff]+"')) 9 | 10 | ################################################################################ 11 | 12 | def _escape_sub(match): 13 | try: 14 | entity_code = ord(match.group(0)) 15 | 16 | except Exception, e: 17 | print match.group(0) 18 | raise 19 | 20 | named_entitiy = htmlentitydefs.codepoint2name.get(entity_code) 21 | if named_entitiy: return '&%s;' % named_entitiy 22 | else: return '&#%d;' % entity_code 23 | 24 | ################################################################################ 25 | 26 | def escape(uni, codec=None): 27 | if codec: uni = uni.decode(codec) 28 | return _escape_re.sub(_escape_sub, uni) 29 | 30 | ehtml = escape 31 | 32 | __all__ = ['escape', 'ehtml'] 33 | 34 | ################################################################################ 35 | 36 | if __name__ == '__main__': 37 | print ehtml( 38 | '“Gross national happiness is more important”', 'utf-8' 39 | ) 40 | 41 | print ehtml('&&', 'utf-8') 42 | 43 | ################################################################################ -------------------------------------------------------------------------------- /test/util/build_page/warnings.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | Alert! Warnings for <? echo $build_tag; ?> Automated Pygame Build Page 12 | 13 | 14 | 15 | 16 |

Alert! Warnings for Automated Pygame Build Page

17 |
18 |

Below are the setup">build warnings for the build from the Spectacularly Adequate Automated Pygame Build Page. Although most warnings are related to casting or types and are harmless, they may indicate a bug or error in the build.

19 |
20 | 21 | 22 | 23 | 24 | 25 |
Automated build warnings:
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |

37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/pygame.h: -------------------------------------------------------------------------------- 1 | /* 2 | pygame - Python Game Library 3 | Copyright (C) 2000-2001 Pete Shinners 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | Pete Shinners 20 | pete@shinners.org 21 | */ 22 | 23 | /* To allow the Pygame C api to be globally shared by all code within an 24 | * extension module built from multiple C files, only include the pygame.h 25 | * header within the top level C file, the one which calls the 26 | * 'import_pygame_*' macros. All other C source files of the module should 27 | * include _pygame.h instead. 28 | */ 29 | #ifndef PYGAME_H 30 | #define PYGAME_H 31 | 32 | #include "_pygame.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /symbian/app/pygame.rss: -------------------------------------------------------------------------------- 1 | // CBAAPP.RSS 2 | // 3 | // Copyright (c) 1997-1999 Symbian Ltd. All rights reserved. 4 | // 5 | 6 | // CbaApp app 7 | // 8 | 9 | NAME SDLT 10 | 11 | #include 12 | #include 13 | #include 14 | //#include 15 | #include 16 | //#include 17 | #include "pygame.hrh" 18 | 19 | RESOURCE RSS_SIGNATURE { } 20 | 21 | RESOURCE TBUF r_default_document_name 22 | { buf="pygame"; } 23 | 24 | RESOURCE EIK_APP_INFO 25 | { 26 | menubar=r_app_menubar; 27 | cba=R_AVKON_SOFTKEYS_EMPTY; 28 | } 29 | 30 | RESOURCE MENU_BAR r_app_menubar 31 | { 32 | titles= 33 | { 34 | //MENU_TITLE { menu_pane=r_cbaapp_file_menu; } 35 | }; 36 | } 37 | 38 | /* 39 | RESOURCE MENU_PANE r_cbaapp_file_menu 40 | { 41 | items= 42 | { 43 | MENU_ITEM { command=EAknCmdExit; txt="Run script"; } 44 | }; 45 | } 46 | */ 47 | 48 | RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info 49 | { 50 | short_caption = "pygame"; 51 | caption_and_icon = CAPTION_AND_ICON_INFO 52 | { 53 | caption = "pygame"; 54 | 55 | number_of_icons = 1; 56 | icon_file = "\\resource\\apps\\pygame_aif.mif"; 57 | 58 | }; 59 | } 60 | 61 | 62 | // End of File 63 | -------------------------------------------------------------------------------- /.travis_osx_rename_whl.py: -------------------------------------------------------------------------------- 1 | """Rename the wheel so that pip will find it for more Pythons. 2 | 3 | Python.org builds and Mac system Python are built as 'fat' binaries, including 4 | both x86 (32 bit) and x86_64 (64 bit) executable code in one file. On these 5 | Pythons, pip will look for wheels with fat libraries, tagged 'intel'. However, 6 | all recent Mac systems run the 64 bit code. 7 | 8 | Therefore, this script tells a small lie about the wheels we're producing. By 9 | claiming they are fat ('intel') wheels, pip will install them on more Python 10 | installations. This should not cause problems for the vast majority of users. 11 | """ 12 | import glob 13 | import os 14 | import sys 15 | 16 | # There should be exactly one .whl 17 | filenames = glob.glob('dist/*.whl') 18 | 19 | if len(filenames) < 1: 20 | sys.exit("No wheels found") 21 | elif len(filenames) > 1: 22 | print("Multiple wheels found:") 23 | for f in filenames: 24 | print(" {}".format(f)) 25 | sys.exit(1) 26 | 27 | path = filenames[0] 28 | 29 | if '_intel' in path: 30 | print("Wheel already tagged 'intel':") 31 | print(path) 32 | sys.exit(0) 33 | elif '_x86_64' not in path: 34 | print("Didn't find '_x86_64' in wheel filename:") 35 | print(path) 36 | sys.exit(1) 37 | 38 | new_path = path.replace('_x86_64', '_intel') 39 | os.rename(path, new_path) 40 | print("Renamed wheel to:") 41 | print(new_path) 42 | -------------------------------------------------------------------------------- /version.py.in: -------------------------------------------------------------------------------- 1 | ## pygame - Python Game Library 2 | ## Copyright (C) 2000-2003 Pete Shinners 3 | ## 4 | ## This library is free software; you can redistribute it and/or 5 | ## modify it under the terms of the GNU Library General Public 6 | ## License as published by the Free Software Foundation; either 7 | ## version 2 of the License, or (at your option) any later version. 8 | ## 9 | ## This library is distributed in the hope that it will be useful, 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | ## Library General Public License for more details. 13 | ## 14 | ## You should have received a copy of the GNU Library General Public 15 | ## License along with this library; if not, write to the Free 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | ## 18 | ## Pete Shinners 19 | ## pete@shinners.org 20 | 21 | """Simply the current installed pygame version. The version information is 22 | stored in the regular pygame module as 'pygame.ver'. Keeping the version 23 | information also available in a separate module allows you to test the 24 | pygame version without importing the main pygame module. 25 | 26 | The python version information should always compare greater than any previous 27 | releases. (hmm, until we get to versions > 10) 28 | """ 29 | 30 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- 1 | """Pygame unit test suite package 2 | 3 | Exports function run() 4 | 5 | A quick way to run the test suite package from the command line 6 | is by importing the go submodule: 7 | 8 | python -m "import pygame.tests" [] 9 | 10 | Command line option --help displays a usage message. Available options 11 | correspond to the pygame.tests.run arguments. 12 | 13 | The xxxx_test submodules of the tests package are unit test suites for 14 | individual parts of Pygame. Each can also be run as a main program. This is 15 | useful if the test, such as cdrom_test, is interactive. 16 | 17 | For Pygame development the test suite can be run from a Pygame distribution 18 | root directory using run_tests.py. Alternately, test/__main__.py can be run 19 | directly. 20 | 21 | """ 22 | 23 | if __name__ == 'pygame.tests': 24 | from pygame.tests.test_utils.run_tests import run 25 | elif __name__ == '__main__': 26 | import os 27 | import sys 28 | pkg_dir = os.path.split(os.path.abspath(__file__))[0] 29 | parent_dir, pkg_name = os.path.split(pkg_dir) 30 | is_pygame_pkg = (pkg_name == 'tests' and 31 | os.path.split(parent_dir)[1] == 'pygame') 32 | if not is_pygame_pkg: 33 | sys.path.insert(0, parent_dir) 34 | 35 | if is_pygame_pkg: 36 | import pygame.tests.__main__ 37 | else: 38 | import test.__main__ 39 | else: 40 | from test.test_utils.run_tests import run 41 | -------------------------------------------------------------------------------- /src/doc/pixelcopy_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMEPIXELCOPY "pygame module for general pixel array copying" 3 | 4 | #define DOC_PYGAMEPIXELCOPYSURFACETOARRAY "surface_to_array(array, surface, kind='P', opaque=255, clear=0) -> None\ncopy surface pixels to an array object" 5 | 6 | #define DOC_PYGAMEPIXELCOPYARRAYTOSURFACE "array_to_surface(, ) -> None\ncopy an array object to a surface" 7 | 8 | #define DOC_PYGAMEPIXELCOPYMAPARRAY "map_array(, , ) -> None\ncopy an array to another array, using surface format" 9 | 10 | #define DOC_PYGAMEPIXELCOPYMAKESURFACE "pygame.pixelcopy.make_surface(array) -> Surface\nCopy an array to a new surface" 11 | 12 | 13 | 14 | /* Docs in a comment... slightly easier to read. */ 15 | 16 | /* 17 | 18 | pygame.pixelcopy 19 | pygame module for general pixel array copying 20 | 21 | pygame.pixelcopy.surface_to_array 22 | surface_to_array(array, surface, kind='P', opaque=255, clear=0) -> None 23 | copy surface pixels to an array object 24 | 25 | pygame.pixelcopy.array_to_surface 26 | array_to_surface(, ) -> None 27 | copy an array object to a surface 28 | 29 | pygame.pixelcopy.map_array 30 | map_array(, , ) -> None 31 | copy an array to another array, using surface format 32 | 33 | pygame.pixelcopy.make_surface 34 | pygame.pixelcopy.make_surface(array) -> Surface 35 | Copy an array to a new surface 36 | 37 | */ -------------------------------------------------------------------------------- /.hgtags: -------------------------------------------------------------------------------- 1 | 08a04cbb47d580474ffea1d6ad5b2902a167117d release_1_8_1rc2 2 | 0b3d6dbbf7b79688f1e2a09012f56f5298266867 0.04 3 | 2383b8ab0e2273bc83c545ab9c18fee1f3459c64 0.06 4 | 249b34b34fe17d1a234d355d978495d3cb78a911 release_1_8_0rc4 5 | 25e3f2cee879facc39ba5a1c6a2b4759a7a77062 release_1_9_0rc3 6 | 2fefed6fb4389d55f500135f932b1717e861702f 0.07 7 | 384d5af1bc8163241b89de36d8408e120fa28349 release_1_8_1_rc3 8 | 47dad2e9b972d3e99488e7784b6c6e3e326b8c84 release_1_9_1release 9 | 4caa22563398875b0a15ff802078950c677ffb48 release_1_8_0rc1 10 | 51234a3be550c9b52ce0a6d31df00efcf0c0b451 release_1_9_0rc1 11 | 5d4e4267a7a6a8e53c9e5736c61b2938575dc01c release_1_9_0rc2 12 | 5d4e4267a7a6a8e53c9e5736c61b2938575dc01c trunk 13 | 7b0689ed6295ea7577ccf59ee57036a60696dc56 release_1_8_1rc1 14 | 8320f94012c1547c022b3e4963f33889b651319c start 15 | 90a137d395e62d7c17e8e52105ef41c21e369adb 0.08 16 | b7eacd62ea721d2c0da99e0475fda1932b328ede release_1_8_1release 17 | d0d67addcde6727d4bb989b5828bda683e3e1242 release_1_8_0rc5 18 | d1cbb8c9d94bc13c9fe22dec1bff5f8a3516bbac 0.09 19 | db2a57c6ca2b3e75077be02da8a3499f763f5170 release_1_8_0release 20 | f1f7ecf6562d89e0af1931604e494a417a2ffe80 release_1_9_0release 21 | f4bdbe826c6e1c29e38998120f9eacb0701aa89c release_1_9_0rc4 22 | 6d6992c8f9038af88b5065a9d55ba52b3ac54d35 1.9.2rc1 23 | 2caabb5e6cae46636e476d28902286772053fb42 1.9.2 24 | 0adec16b9f359b5747d0eb7027a45150a467b1c1 1.9.3rc1 25 | 32f711221735d05b1a2812eb646ada0678702401 1.9.3rc1a 26 | 40f06fceff8ba2ce1e969b0b9bd0b59f25777d52 1.9.3rc2 27 | 8a7d8264d9ea0724212c02cf585666824bbd75df 1.9.3 28 | -------------------------------------------------------------------------------- /appveyor/install.ps1: -------------------------------------------------------------------------------- 1 | function InstallPackage ($python_home, $pkg) { 2 | $pip_path = $python_home + "/Scripts/pip.exe" 3 | & $pip_path install $pkg 4 | } 5 | 6 | function DownloadPrebuilt () { 7 | $webclient = New-Object System.Net.WebClient 8 | 9 | $download_url = "https://bitbucket.org/llindstrom/pygame/downloads/" 10 | $build_date = "20150922" 11 | $target = "x86" 12 | if ($env:PYTHON_ARCH -eq "64") { 13 | $target = "x64" 14 | } 15 | $prebuilt_file = "prebuilt-"+$target+"-pygame-1.9.2-"+$build_date+".zip" 16 | $prebuilt_url = $download_url + $prebuilt_file 17 | $prebuilt_zip = "prebuilt-" + $target + ".zip" 18 | 19 | $basedir = $pwd.Path + "\" 20 | $filepath = $basedir + $prebuilt_zip 21 | if (Test-Path $filepath) { 22 | Write-Host "Reusing" $filepath 23 | return $filepath 24 | } 25 | 26 | # Download and retry up to 5 times in case of network transient errors. 27 | Write-Host "Downloading" $filename "from" $prebuilt_url 28 | $retry_attempts = 3 29 | for($i=0; $i -lt $retry_attempts; $i++){ 30 | try { 31 | $webclient.DownloadFile($prebuilt_url, $filepath) 32 | break 33 | } 34 | Catch [Exception]{ 35 | Start-Sleep 1 36 | } 37 | } 38 | Write-Host "File saved at" $filepath 39 | 40 | & 7z x $prebuilt_zip 41 | } 42 | 43 | 44 | function main () { 45 | InstallPackage $env:PYTHON wheel 46 | & DownloadPrebuilt 47 | } 48 | 49 | main 50 | -------------------------------------------------------------------------------- /src/scale_mmx.c: -------------------------------------------------------------------------------- 1 | /* 2 | pygame - Python Game Library 3 | Copyright (C) 2000-2001 Pete Shinners 4 | Copyright (C) 2007 Rene Dudfield, Richard Goedeken 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | 20 | Pete Shinners 21 | pete@shinners.org 22 | */ 23 | 24 | /* Pentium MMX/SSE smoothscale routines 25 | * These are only compiled with GCC. 26 | */ 27 | #if defined(__GNUC__) 28 | /* Choose between the 32 bit and 64 bit versions. 29 | * Including source code like this may be frowned upon by some, 30 | * but the alternative is ungainly conditionally compiled code. 31 | */ 32 | # if defined(__x86_64__) 33 | # include "scale_mmx64.c" 34 | # elif defined(__i386__) 35 | # include "scale_mmx32.c" 36 | # endif 37 | #endif 38 | 39 | #if defined(_M_X64) && !defined(_NO_MMX_FOR_X86_64) 40 | #include "scale_mmx64_msvc.c" 41 | #endif 42 | -------------------------------------------------------------------------------- /mingw32distutils.py: -------------------------------------------------------------------------------- 1 | # module mingw32distutils.py 2 | # Requires Python 2.1 or better. 3 | 4 | """Enhance distutils mingw32 compilation by adding Win32 GUI/console support.""" 5 | 6 | from distutils import ccompiler 7 | from distutils.errors import DistutilsModuleError 8 | 9 | compilers = ['mingw32', 'mingw32-console'] 10 | 11 | # Add the compiler classes to the ccompiler table. Unfortunate hacks follow. 12 | 13 | compiler_class = ccompiler.compiler_class 14 | value = compiler_class['mingw32'] 15 | assert len(value) == 3, "distutils.ccompiler.compiler_class has changed" 16 | compiler_class['mingw32'] = ('', '', 17 | value[2] + ", Win32 GUI shared libraries defaullt") 18 | compiler_class['mingw32-console'] = ('', '', 19 | value[2] + ", console shared libraries") 20 | 21 | original_new_compiler = ccompiler.new_compiler 22 | def new_compiler (plat=None, 23 | compiler=None, 24 | verbose=0, 25 | dry_run=0, 26 | force=0): 27 | """Recognizes replacement mingw32 compiler classes""" 28 | 29 | if compiler == 'mingw32': 30 | from mingw32ccompiler import Mingw32DefaultCCompiler 31 | return Mingw32DefaultCCompiler (None, dry_run, force) 32 | if compiler == 'mingw32-console': 33 | from mingw32ccompiler import Mingw32ConsoleCCompiler 34 | return Mingw32ConsoleCCompiler (None, dry_run, force) 35 | return original_new_compiler (plat, compiler, verbose, dry_run, force) 36 | 37 | ccompiler.new_compiler = new_compiler 38 | -------------------------------------------------------------------------------- /test/util/build_page/results/results.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin:0; 3 | padding:0; 4 | } 5 | 6 | body h1, body p { 7 | margin:10px; 8 | } 9 | 10 | /* Contains the entire tabbed section */ 11 | .tabbed { } 12 | 13 | /* List of tabs */.tabbed ul.tabs { 14 | float: left; 15 | display: inline; 16 | width: 100%; 17 | margin: 0; 18 | padding: 0; 19 | /*background-color: #EEEEEE;*/ 20 | 21 | border-top:1px solid #006c03; 22 | border-bottom:1px solid #006c03; 23 | background:#DDDD44; 24 | 25 | } 26 | 27 | .tabbed ul.tabs li { 28 | list-style-type: none; 29 | float: left; 30 | margin: 0; 31 | padding: 0; 32 | } 33 | .tabbed ul.tabs li a { 34 | overflow: hidden; 35 | display: block; 36 | margin: 0 2px 0 0; 37 | padding: 10px 12px; 38 | } 39 | .tabbed ul.tabs li a:hover { 40 | } 41 | 42 | /* The current selected tab */ 43 | .tabbed ul.tabs li a.tab-current { 44 | 45 | border: 2px solid black; 46 | 47 | } 48 | 49 | /* The content shown when a tab is selected */ 50 | .tabbed div { 51 | float: left; 52 | display: block; 53 | width: 100%; 54 | padding: 10px; 55 | } 56 | 57 | /* Set the CSS to make sure the other tabs' content isn't shown other than the first 58 | .tabbed div.t2, .tabbed div.t3, .tabbed div.t4 { 59 | display: none; 60 | } 61 | */ 62 | /* Content for inside your tabs' divs */ 63 | .tabbed div ul { 64 | } 65 | .tabbed div p { 66 | } 67 | .tabbed div div { 68 | } -------------------------------------------------------------------------------- /examples/headless_no_windows_needed.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """How to use pygame with no windowing system, like on headless servers. 3 | 4 | Thumbnail generation with scaling is an example of what you can do with pygame. 5 | NOTE: the pygame scale function uses mmx/sse if available, and can be run 6 | in multiple threads. 7 | 8 | """ 9 | useage = """-scale inputimage outputimage new_width new_height 10 | eg. -scale in.png out.png 50 50 11 | 12 | """ 13 | 14 | import os, sys 15 | 16 | # set SDL to use the dummy NULL video driver, 17 | # so it doesn't need a windowing system. 18 | os.environ["SDL_VIDEODRIVER"] = "dummy" 19 | 20 | 21 | import pygame.transform 22 | 23 | 24 | if 1: 25 | #some platforms need to init the display for some parts of pygame. 26 | import pygame.display 27 | pygame.display.init() 28 | screen = pygame.display.set_mode((1,1)) 29 | 30 | 31 | 32 | def scaleit(fin, fout, w, h): 33 | i = pygame.image.load(fin) 34 | 35 | if hasattr(pygame.transform, "smoothscale"): 36 | scaled_image = pygame.transform.smoothscale(i, (w,h)) 37 | else: 38 | scaled_image = pygame.transform.scale(i, (w,h)) 39 | pygame.image.save(scaled_image, fout) 40 | 41 | def main(fin, fout, w, h): 42 | """smoothscale image file named fin as fout with new size (w,h)""" 43 | scaleit(fin, fout, w, h) 44 | 45 | if __name__ == "__main__": 46 | if "-scale" in sys.argv: 47 | fin, fout, w, h = sys.argv[2:] 48 | w, h = map(int, [w,h]) 49 | main(fin, fout, w,h) 50 | else: 51 | print (useage) 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /examples/sound.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """extremely simple demonstration playing a soundfile 4 | and waiting for it to finish. you'll need the pygame.mixer 5 | module for this to work. Note how in this simple example we 6 | don't even bother loading all of the pygame package. Just 7 | pick the mixer for sound and time for the delay function. 8 | 9 | Optional command line argument: 10 | the name of an audio file. 11 | 12 | 13 | """ 14 | 15 | import os.path, sys 16 | import pygame.mixer, pygame.time 17 | mixer = pygame.mixer 18 | time = pygame.time 19 | 20 | main_dir = os.path.split(os.path.abspath(__file__))[0] 21 | 22 | def main(file_path=None): 23 | """Play an audio file as a buffered sound sample 24 | 25 | Option argument: 26 | the name of an audio file (default data/secosmic_low.wav 27 | 28 | """ 29 | if file_path is None: 30 | file_path = os.path.join(main_dir, 31 | 'data', 32 | 'secosmic_lo.wav') 33 | 34 | #choose a desired audio format 35 | mixer.init(11025) #raises exception on fail 36 | 37 | 38 | #load the sound 39 | sound = mixer.Sound(file_path) 40 | 41 | 42 | #start playing 43 | print ('Playing Sound...') 44 | channel = sound.play() 45 | 46 | 47 | #poll until finished 48 | while channel.get_busy(): #still playing 49 | print (' ...still going...') 50 | time.wait(1000) 51 | print ('...Finished') 52 | 53 | if __name__ == '__main__': 54 | if len(sys.argv) > 1: 55 | main(sys.argv[1]) 56 | else: 57 | main() 58 | -------------------------------------------------------------------------------- /symbian/SConscript.Vorbis.py: -------------------------------------------------------------------------------- 1 | Import("*") 2 | 3 | # This file is generated with mmp2sconscript 4 | from scons_symbian import * 5 | 6 | target = "vorbis" 7 | targettype = "lib" 8 | libraries = [] 9 | # Static libs 10 | libraries += [] 11 | 12 | 13 | uid3 = 0 14 | 15 | 16 | 17 | sources = ['deps/vorbis/lib/analysis.c', 18 | 'deps/vorbis/lib/barkmel.c', 19 | 'deps/vorbis/lib/bitrate.c', 20 | 'deps/vorbis/lib/block.c', 21 | 'deps/vorbis/lib/codebook.c', 22 | 'deps/vorbis/lib/envelope.c', 23 | 'deps/vorbis/lib/floor0.c', 24 | 'deps/vorbis/lib/floor1.c', 25 | 'deps/vorbis/lib/info.c', 26 | 'deps/vorbis/lib/lookup.c', 27 | 'deps/vorbis/lib/lpc.c', 28 | 'deps/vorbis/lib/lsp.c', 29 | 'deps/vorbis/lib/mapping0.c', 30 | 'deps/vorbis/lib/mdct.c', 31 | 'deps/vorbis/lib/psy.c', 32 | 'deps/vorbis/lib/registry.c', 33 | 'deps/vorbis/lib/res0.c', 34 | 'deps/vorbis/lib/sharedbook.c', 35 | 'deps/vorbis/lib/smallft.c', 36 | 'deps/vorbis/lib/synthesis.c', 37 | 'deps/vorbis/lib/vorbisfile.c', 38 | 'deps/vorbis/lib/window.c'] 39 | 40 | 41 | includes = ['deps/SDL/symbian', 'deps/vorbis/include', 'deps/vorbis/include/vorbis'] 42 | sysincludes = [EPOC32_INCLUDE, C_INCLUDE, 'deps/ogg/include', 'deps/ogg/symbian'] 43 | 44 | defines = [] 45 | if COMPILER == COMPILER_GCCE: 46 | defines += ['alloca=__builtin_alloca'] 47 | if USE_OPENC: 48 | defines += [ 'OPENC' ] 49 | 50 | SymbianProgram( target, targettype, 51 | sources = sources, 52 | includes = includes, 53 | sysincludes = sysincludes, 54 | libraries = libraries, 55 | defines = defines, 56 | uid3 = uid3, 57 | winscw_options = "-relax_pointers", 58 | ) 59 | 60 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/Dockerfile-x86_64: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux1_x86_64 2 | 3 | # Set up repoforge 4 | COPY RPM-GPG-KEY.dag.txt /tmp/ 5 | RUN rpm --import /tmp/RPM-GPG-KEY.dag.txt 6 | 7 | ENV RPMFORGE_FILE "rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm" 8 | ADD "https://repoforge.cu.be/redhat/el5/en/x86_64/dag/RPMS/${RPMFORGE_FILE}" /tmp/${RPMFORGE_FILE} 9 | 10 | RUN rpm -i /tmp/${RPMFORGE_FILE} 11 | 12 | # Install SDL and portmidi dependencies 13 | RUN yum install -y zlib-devel libjpeg-devel libX11-devel\ 14 | alsa-lib-devel mesa-libGLU-devel audiofile-devel \ 15 | cmake alsa-lib-devel java-1.7.0-openjdk-devel jpackage-utils libtiff-devel \ 16 | mikmod-devel smpeg-devel giflib-devel libsndfile-devel dbus-devel \ 17 | pulseaudio-libs-devel xz 18 | 19 | # Build and install PNG 20 | ADD libpng /png_build/ 21 | RUN ["bash", "/png_build/build-png.sh"] 22 | 23 | # Build and install WEBP 24 | ADD libwebp /webp_build/ 25 | RUN ["bash", "/webp_build/build-webp.sh"] 26 | 27 | # Build and install freetype 28 | ADD freetype /freetype_build/ 29 | RUN ["bash", "/freetype_build/build-freetype.sh"] 30 | 31 | # Build and install fluidsynth 32 | ADD fluidsynth /fluidsynth_build/ 33 | RUN ["bash", "/fluidsynth_build/build-fluidsynth.sh"] 34 | 35 | ADD ogg /ogg_build/ 36 | RUN ["bash", "/ogg_build/build-ogg.sh"] 37 | 38 | # Build and install flac 39 | ADD flac /flac_build/ 40 | RUN ["bash", "/flac_build/build-flac.sh"] 41 | 42 | # Build and install SDL 43 | ADD sdl_libs /sdl_build/ 44 | RUN ["bash", "/sdl_build/build-sdl-libs.sh"] 45 | 46 | # Build and install SDL and portmidi 47 | ADD portmidi /portmidi_build/ 48 | RUN ["bash", "/portmidi_build/build-portmidi.sh"] 49 | -------------------------------------------------------------------------------- /examples/overlay.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | import pygame 5 | from pygame.compat import xrange_ 6 | 7 | SR= (800,600) 8 | ovl= None 9 | 10 | ######################################################################## 11 | # Simple video player 12 | def vPlayer( fName ): 13 | global ovl 14 | f= open( fName, 'rb' ) 15 | fmt= f.readline().strip() 16 | res= f.readline().strip() 17 | col= f.readline().strip() 18 | if fmt!= "P5": 19 | print ('Unknown format( len %d ). Exiting...' % len( fmt )) 20 | return 21 | 22 | w,h= [ int(x) for x in res.split( ' ' ) ] 23 | h= ( h* 2 )/ 3 24 | # Read into strings 25 | y= f.read( w*h ) 26 | u= [] 27 | v= [] 28 | for i in xrange_( 0, h/2 ): 29 | u.append( f.read( w/2 )) 30 | v.append( f.read( w/2 )) 31 | 32 | u= ''.join(u) 33 | v= ''.join(v) 34 | 35 | # Open overlay with the resolution specified 36 | ovl= pygame.Overlay(pygame.YV12_OVERLAY, (w,h)) 37 | ovl.set_location(0, 0, w, h) 38 | 39 | ovl.display((y,u,v)) 40 | while 1: 41 | pygame.time.wait(10) 42 | for ev in pygame.event.get(): 43 | if ev.type in (pygame.KEYDOWN, pygame.QUIT): 44 | return 45 | 46 | 47 | def main(fname): 48 | """play video file fname""" 49 | pygame.init() 50 | try: 51 | pygame.display.set_mode(SR) 52 | vPlayer(fname) 53 | finally: 54 | pygame.quit() 55 | 56 | # Test all modules 57 | if __name__== '__main__': 58 | if len( sys.argv )!= 2: 59 | print ("Usage: play_file ") 60 | else: 61 | main(sys.argv[1]) 62 | 63 | -------------------------------------------------------------------------------- /test/util/build_page/results/index.py: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | """:" 3 | PYTHONPATH=/home/wazoocom/www/pygame/libs exec /home/wazoocom/bin/python $0 ${1+"$@"} 4 | """ 5 | 6 | from __future__ import with_statement 7 | 8 | import os 9 | 10 | from pywebsite import * 11 | from helpers import * 12 | 13 | def main(): 14 | q = cgi.FieldStorage() 15 | 16 | platform_id = q['platform_id'].value 17 | revision = q['revision'].value 18 | which_info = q.has_key('info') and q['info'].value.strip() or 'setup' 19 | 20 | results_zip = '%s_%s.zip' % (platform_id, revision) 21 | 22 | rz = ResultsZip('%s/archives/%s' % (platform_id, results_zip) ) 23 | 24 | tabs, tab_contents = rz.html(which_info) 25 | 26 | TEMPLATE = """ 27 | 28 | 29 | 30 | 31 | 32 | Build Info for %(platform_id)s 33 | 34 | 35 | 36 | 37 | 38 | 39 |

%(results_zip)s

40 | 41 |

builds

42 | 43 |
44 | 45 |
    46 | 47 | %(tabs)s 48 | 49 |
50 | 51 | %(tab_contents)s 52 | 53 |
54 | 55 | 56 | """ 57 | 58 | print TEMPLATE % locals() 59 | 60 | try: 61 | main() 62 | except Exception, e: 63 | print 'woah woah!' -------------------------------------------------------------------------------- /msysio.py: -------------------------------------------------------------------------------- 1 | # module msysio.py 2 | # Requires Python 2.2 or better. 3 | 4 | """Provide helpful routines for interactive IO on the MSYS console""" 5 | 6 | # Output needs to be flushed to be seen. It is especially important 7 | # when prompting for user input. 8 | 9 | import sys 10 | import os 11 | 12 | __all__ = ['raw_input_', 'print_', 'is_msys'] 13 | 14 | # 2.x/3.x compatibility stuff 15 | try: 16 | raw_input 17 | except NameError: 18 | raw_input = input 19 | 20 | # Exported functions 21 | __all__ = ['raw_input_', 'print_', 'is_msys'] 22 | 23 | # 2.x/3.x compatibility stuff 24 | try: 25 | raw_input 26 | except NameError: 27 | raw_input = input 28 | 29 | # Exported functions 30 | def raw_input_(prompt=None): 31 | """Prompt for user input in an MSYS console friendly way""" 32 | if prompt is None: 33 | prompt = '' 34 | print_(prompt, end='') 35 | return raw_input() 36 | 37 | def print_(*args, **kwds): 38 | """Print arguments in an MSYS console friendly way 39 | 40 | Keyword arguments: 41 | file, sep, end 42 | """ 43 | 44 | stream = kwds.get('file', sys.stdout) 45 | sep = kwds.get('sep', ' ') 46 | end = kwds.get('end', '\n') 47 | 48 | if args: 49 | stream.write(sep.join([str(arg) for arg in args])) 50 | if end: 51 | stream.write(end) 52 | try: 53 | stream.flush() 54 | except AttributeError: 55 | pass 56 | 57 | def is_msys(): 58 | """Return true if the execution environment is MSYS""" 59 | 60 | try: 61 | # Unfortunately there is no longer an MSYS specific identifier. 62 | return os.environ['TERM'] == 'cygwin' 63 | except KeyError: 64 | return False 65 | -------------------------------------------------------------------------------- /src/doc/sndarray_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMESNDARRAY "pygame module for accessing sound sample data" 3 | 4 | #define DOC_PYGAMESNDARRAYARRAY "array(Sound) -> array\ncopy Sound samples into an array" 5 | 6 | #define DOC_PYGAMESNDARRAYSAMPLES "samples(Sound) -> array\nreference Sound samples into an array" 7 | 8 | #define DOC_PYGAMESNDARRAYMAKESOUND "make_sound(array) -> Sound\nconvert an array into a Sound object" 9 | 10 | #define DOC_PYGAMESNDARRAYUSEARRAYTYPE "use_arraytype (arraytype) -> None\nSets the array system to be used for sound arrays" 11 | 12 | #define DOC_PYGAMESNDARRAYGETARRAYTYPE "get_arraytype () -> str\nGets the currently active array type." 13 | 14 | #define DOC_PYGAMESNDARRAYGETARRAYTYPES "get_arraytypes () -> tuple\nGets the array system types currently supported." 15 | 16 | 17 | 18 | /* Docs in a comment... slightly easier to read. */ 19 | 20 | /* 21 | 22 | pygame.sndarray 23 | pygame module for accessing sound sample data 24 | 25 | pygame.sndarray.array 26 | array(Sound) -> array 27 | copy Sound samples into an array 28 | 29 | pygame.sndarray.samples 30 | samples(Sound) -> array 31 | reference Sound samples into an array 32 | 33 | pygame.sndarray.make_sound 34 | make_sound(array) -> Sound 35 | convert an array into a Sound object 36 | 37 | pygame.sndarray.use_arraytype 38 | use_arraytype (arraytype) -> None 39 | Sets the array system to be used for sound arrays 40 | 41 | pygame.sndarray.get_arraytype 42 | get_arraytype () -> str 43 | Gets the currently active array type. 44 | 45 | pygame.sndarray.get_arraytypes 46 | get_arraytypes () -> tuple 47 | Gets the array system types currently supported. 48 | 49 | */ -------------------------------------------------------------------------------- /test/overlay_test.py: -------------------------------------------------------------------------------- 1 | #################################### IMPORTS ################################### 2 | 3 | if __name__ == '__main__': 4 | import sys 5 | import os 6 | pkg_dir = os.path.split(os.path.abspath(__file__))[0] 7 | parent_dir, pkg_name = os.path.split(pkg_dir) 8 | is_pygame_pkg = (pkg_name == 'tests' and 9 | os.path.split(parent_dir)[1] == 'pygame') 10 | if not is_pygame_pkg: 11 | sys.path.insert(0, parent_dir) 12 | else: 13 | is_pygame_pkg = __name__.startswith('pygame.tests.') 14 | 15 | import unittest 16 | 17 | ################################################################################ 18 | 19 | class OverlayTypeTest(unittest.TestCase): 20 | def todo_test_display(self): 21 | 22 | # __doc__ (as of 2008-08-02) for pygame.overlay.overlay.display: 23 | 24 | # Overlay.display((y, u, v)): return None 25 | # Overlay.display(): return None 26 | # set the overlay pixel data 27 | 28 | self.fail() 29 | 30 | def todo_test_get_hardware(self): 31 | 32 | # __doc__ (as of 2008-08-02) for pygame.overlay.overlay.get_hardware: 33 | 34 | # Overlay.get_hardware(rect): return int 35 | # test if the Overlay is hardware accelerated 36 | 37 | self.fail() 38 | 39 | def todo_test_set_location(self): 40 | 41 | # __doc__ (as of 2008-08-02) for pygame.overlay.overlay.set_location: 42 | 43 | # Overlay.set_location(rect): return None 44 | # control where the overlay is displayed 45 | 46 | self.fail() 47 | 48 | ################################################################################ 49 | 50 | if __name__ == '__main__': 51 | unittest.main() 52 | -------------------------------------------------------------------------------- /docs/logos.html: -------------------------------------------------------------------------------- 1 | Pygame Logos 4 | 5 | 6 | 7 | 8 | 9 |

pygame logos
10 | 11 | These logos are available for use in your own game projects. 12 | Please put them up wherever you see fit. The logo was created 13 | by TheCorruptor on July 29, 2001. 14 | 15 | 16 |
17 | 18 |

19 | There is a higher resolution layered photoshop image 20 | available here. 21 | (1.3 MB)

22 | 23 |
24 |
25 | pygame_logo.gif - 676 x 200
26 |

27 |
28 | pygame_small.gif - 338 x 100
29 |

30 |
31 | pygame_tiny.gif - 200 x 60
32 |
33 | 34 |

35 |
36 | pygame_powered.gif - 250 x 100
37 |


 
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/doc/scrap_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMESCRAP "pygame module for clipboard support." 3 | 4 | #define DOC_PYGAMESCRAPINIT "init () -> None\nInitializes the scrap module." 5 | 6 | #define DOC_PYGAMESCRAPGET "get (type) -> bytes\nGets the data for the specified type from the clipboard." 7 | 8 | #define DOC_PYGAMESCRAPGETTYPES "get_types () -> list\nGets a list of the available clipboard types." 9 | 10 | #define DOC_PYGAMESCRAPPUT "put(type, data) -> None\nPlaces data into the clipboard." 11 | 12 | #define DOC_PYGAMESCRAPCONTAINS "contains (type) -> bool\nChecks, whether a certain type is available in the clipboard." 13 | 14 | #define DOC_PYGAMESCRAPLOST "lost() -> bool\nChecks whether the clipboard is currently owned by the application." 15 | 16 | #define DOC_PYGAMESCRAPSETMODE "set_mode(mode) -> None\nSets the clipboard access mode." 17 | 18 | 19 | 20 | /* Docs in a comment... slightly easier to read. */ 21 | 22 | /* 23 | 24 | pygame.scrap 25 | pygame module for clipboard support. 26 | 27 | pygame.scrap.init 28 | init () -> None 29 | Initializes the scrap module. 30 | 31 | pygame.scrap.get 32 | get (type) -> bytes 33 | Gets the data for the specified type from the clipboard. 34 | 35 | pygame.scrap.get_types 36 | get_types () -> list 37 | Gets a list of the available clipboard types. 38 | 39 | pygame.scrap.put 40 | put(type, data) -> None 41 | Places data into the clipboard. 42 | 43 | pygame.scrap.contains 44 | contains (type) -> bool 45 | Checks, whether a certain type is available in the clipboard. 46 | 47 | pygame.scrap.lost 48 | lost() -> bool 49 | Checks whether the clipboard is currently owned by the application. 50 | 51 | pygame.scrap.set_mode 52 | set_mode(mode) -> None 53 | Sets the clipboard access mode. 54 | 55 | */ -------------------------------------------------------------------------------- /test/sysfont_test.py: -------------------------------------------------------------------------------- 1 | #################################### IMPORTS ################################### 2 | 3 | if __name__ == '__main__': 4 | import sys 5 | import os 6 | pkg_dir = os.path.split(os.path.abspath(__file__))[0] 7 | parent_dir, pkg_name = os.path.split(pkg_dir) 8 | is_pygame_pkg = (pkg_name == 'tests' and 9 | os.path.split(parent_dir)[1] == 'pygame') 10 | if not is_pygame_pkg: 11 | sys.path.insert(0, parent_dir) 12 | else: 13 | is_pygame_pkg = __name__.startswith('pygame.tests.') 14 | 15 | import unittest 16 | 17 | ################################################################################ 18 | 19 | class SysfontModuleTest(unittest.TestCase): 20 | def todo_test_create_aliases(self): 21 | 22 | # __doc__ (as of 2008-08-02) for pygame.sysfont.create_aliases: 23 | 24 | # 25 | 26 | self.fail() 27 | 28 | def todo_test_initsysfonts(self): 29 | 30 | # __doc__ (as of 2008-08-02) for pygame.sysfont.initsysfonts: 31 | 32 | # 33 | 34 | self.fail() 35 | 36 | def todo_test_initsysfonts_darwin(self): 37 | 38 | # __doc__ (as of 2008-08-02) for pygame.sysfont.initsysfonts_darwin: 39 | 40 | # 41 | 42 | self.fail() 43 | 44 | def todo_test_initsysfonts_unix(self): 45 | 46 | # __doc__ (as of 2008-08-02) for pygame.sysfont.initsysfonts_unix: 47 | 48 | # 49 | 50 | self.fail() 51 | 52 | def todo_test_initsysfonts_win32(self): 53 | 54 | # __doc__ (as of 2008-08-02) for pygame.sysfont.initsysfonts_win32: 55 | 56 | # 57 | 58 | self.fail() 59 | 60 | ################################################################################ 61 | 62 | if __name__ == '__main__': 63 | unittest.main() 64 | -------------------------------------------------------------------------------- /src/doc/image_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMEIMAGE "pygame module for image transfer" 3 | 4 | #define DOC_PYGAMEIMAGELOAD "load(filename) -> Surface\nload(fileobj, namehint="") -> Surface\nload new image from a file" 5 | 6 | #define DOC_PYGAMEIMAGESAVE "save(Surface, filename) -> None\nsave an image to disk" 7 | 8 | #define DOC_PYGAMEIMAGEGETEXTENDED "get_extended() -> bool\ntest if extended image formats can be loaded" 9 | 10 | #define DOC_PYGAMEIMAGETOSTRING "tostring(Surface, format, flipped=False) -> string\ntransfer image to string buffer" 11 | 12 | #define DOC_PYGAMEIMAGEFROMSTRING "fromstring(string, size, format, flipped=False) -> Surface\ncreate new Surface from a string buffer" 13 | 14 | #define DOC_PYGAMEIMAGEFROMBUFFER "frombuffer(string, size, format) -> Surface\ncreate a new Surface that shares data inside a string buffer" 15 | 16 | 17 | 18 | /* Docs in a comment... slightly easier to read. */ 19 | 20 | /* 21 | 22 | pygame.image 23 | pygame module for image transfer 24 | 25 | pygame.image.load 26 | load(filename) -> Surface 27 | load(fileobj, namehint="") -> Surface 28 | load new image from a file 29 | 30 | pygame.image.save 31 | save(Surface, filename) -> None 32 | save an image to disk 33 | 34 | pygame.image.get_extended 35 | get_extended() -> bool 36 | test if extended image formats can be loaded 37 | 38 | pygame.image.tostring 39 | tostring(Surface, format, flipped=False) -> string 40 | transfer image to string buffer 41 | 42 | pygame.image.fromstring 43 | fromstring(string, size, format, flipped=False) -> Surface 44 | create new Surface from a string buffer 45 | 46 | pygame.image.frombuffer 47 | frombuffer(string, size, format) -> Surface 48 | create a new Surface that shares data inside a string buffer 49 | 50 | */ -------------------------------------------------------------------------------- /manylinux-build/docker_base/Dockerfile-i686: -------------------------------------------------------------------------------- 1 | FROM quay.io/pypa/manylinux1_i686 2 | 3 | # Set up repoforge 4 | COPY RPM-GPG-KEY.dag.txt /tmp/ 5 | RUN rpm --import /tmp/RPM-GPG-KEY.dag.txt 6 | 7 | ENV RPMFORGE_FILE "rpmforge-release-0.5.3-1.el5.rf.i386.rpm" 8 | ADD "https://repoforge.cu.be/redhat/el5/en/i386/dag/RPMS/${RPMFORGE_FILE}" /tmp/${RPMFORGE_FILE} 9 | 10 | RUN rpm -i /tmp/${RPMFORGE_FILE} 11 | 12 | # Install SDL and portmidi dependencies 13 | RUN linux32 yum install -y zlib-devel libjpeg-devel libX11-devel freetype-devel \ 14 | alsa-lib-devel mesa-libGLU-devel audiofile-devel \ 15 | alsa-lib-devel java-1.7.0-openjdk-devel jpackage-utils xz libtiff-devel \ 16 | giflib-devel mikmod-devel 17 | RUN linux32 yum install -y libsndfile-devel libsndfile smpeg-devel dbus-devel \ 18 | pulseaudio-libs-devel cmake 19 | 20 | # Build and install PNG 21 | ADD libpng /png_build/ 22 | RUN ["linux32", "bash", "/png_build/build-png.sh"] 23 | 24 | # Build and install WEBP 25 | ADD libwebp /webp_build/ 26 | RUN ["linux32", "bash", "/webp_build/build-webp.sh"] 27 | 28 | # Build and install freetype 29 | ADD freetype /freetype_build/ 30 | RUN ["linux32", "bash", "/freetype_build/build-freetype.sh"] 31 | 32 | # Build and install fluidsynth 33 | ADD fluidsynth /fluidsynth_build/ 34 | RUN ["linux32", "bash", "/fluidsynth_build/build-fluidsynth.sh"] 35 | 36 | ADD ogg /ogg_build/ 37 | RUN ["linux32", "bash", "/ogg_build/build-ogg.sh"] 38 | 39 | # Build and install flac 40 | ADD flac /flac_build/ 41 | RUN ["linux32", "bash", "/flac_build/build-flac.sh"] 42 | 43 | # Build and install SDL 44 | ADD sdl_libs /sdl_build/ 45 | RUN ["linux32", "bash", "/sdl_build/build-sdl-libs.sh"] 46 | 47 | # Build and install SDL and portmidi 48 | ADD portmidi /portmidi_build/ 49 | RUN ["linux32", "bash", "/portmidi_build/build-portmidi.sh"] 50 | -------------------------------------------------------------------------------- /manylinux-build/docker_base/RPM-GPG-KEY.dag.txt: -------------------------------------------------------------------------------- 1 | The following public key can be used to verify RPM packages 2 | downloaded from http://dag.wieers.com/apt/ using 'rpm -K' 3 | if you have the GNU GPG package. 4 | Questions about this key should be sent to: 5 | Dag Wieers 6 | 7 | -----BEGIN PGP PUBLIC KEY BLOCK----- 8 | Version: GnuPG v1.2.1 (GNU/Linux) 9 | 10 | mQGiBD9JMT0RBAC9Q2B0AloUMTxaK73sD0cOu1MMdD8yuDagbMlDtUYA1aGeJVO6 11 | TV02JLGr67OBY+UkYuC1c3PUwmb3+jakZd5bW1L8E2L705wS0129xQOZPz6J+alF 12 | 5rTzVkiefg8ch1yEcMayK20NdyOmhDGXQXNQS8OJFLTIC6bJs+7MZL83/wCg3cG3 13 | 3q7MWHm3IpJb+6QKpB9YH58D/2WjPDK+7YIky/JbFBT4JPgTSBy611+bLqHA6PXq 14 | 39tzY6un8KDznAMNtm+NAsr6FEG8PHe406+tbgd7tBkecz3HPX8nR5v0JtDT+gzN 15 | 8fM3kAiAzjCHUAFWVAMAZLr5TXuoq4lGTTxvZbwTjZfyjCm7gIieCu8+qnPWh6hm 16 | 30NgA/0ZyEHG6I4rOWqPks4vZuD+wlp5XL8moBXEKfEVOMh2MCNDRGnvVHu1P3eD 17 | oHOooVMt9sWrGcgxpYuupPNL4Uf6B6smiLlH6D4tEg+qCxC17zABI5572XJTJ170 18 | JklZJrPGtnkPrrKMamnN9MU4RjGmjh9JZPa7rKjZHyWP/z/CBrQ1RGFnIFdpZWVy 19 | cyAoRGFnIEFwdCBSZXBvc2l0b3J5IHYxLjApIDxkYWdAd2llZXJzLmNvbT6IWQQT 20 | EQIAGQUCP0kxPQQLBwMCAxUCAwMWAgECHgECF4AACgkQog5SFGuNeeYvDQCeKHST 21 | hIq/WzFBXtJOnQkJGSqAoHoAnRtsJVWYmzYKHqzkRx1qAzL18Sd0iEYEEBECAAYF 22 | Aj9JMWAACgkQoj2iXPqnmevnOACfRQaageMcESHVE1+RSuP3txPUvoEAoJAtOHon 23 | g+3SzVNSZLn/g7/Ljfw+uQENBD9JMT8QBACj1QzRptL6hbpWl5DdQ2T+3ekEjJGt 24 | llCwt4Mwt/yOHDhzLe8SzUNyYxTXUL4TPfFvVW9/j8WOkNGvffbs7g84k7a5h/+l 25 | IJTTlP9V9NruDt1dlrBe+mWF6eCY55OFHjb6nOIkcJwKxRd3nGlWnLsz0ce9Hjrg 26 | 6lMrn0lPsMV6swADBQP9H42sss6mlqnJEFA97Fl3V9s+7UVJoAIA5uSVXxEOwVoh 27 | Vq7uECQRvWzif6tzOY+vHkUxOBRvD6oIU6tlmuG3WByKyA1d0MTqMr3eWieSYf/L 28 | n5VA9NuD7NwjFA1kLkoDwfSbsF51LppTMkUggzwgvwE46MB6yyuqAVI1kReAWw+I 29 | RgQYEQIABgUCP0kxPwAKCRCiDlIUa4155oktAKDAzm9QYbDpk6SrQhkSFy016BjE 30 | BACeJU1hpElFnUZCL4yKj4EuLnlo8kc= 31 | =mqUt 32 | -----END PGP PUBLIC KEY BLOCK----- 33 | -------------------------------------------------------------------------------- /docs/reST/ext/headers.py: -------------------------------------------------------------------------------- 1 | from ext.utils import get_sectionname, isections 2 | from ext.indexer import tour_descinfo 3 | 4 | import os 5 | 6 | 7 | def setup(app): 8 | # This extension uses indexer collected tables. 9 | app.setup_extension('ext.indexer') 10 | 11 | # The target directory for the header files. 12 | app.add_config_value('headers_dest', '.', 'html') 13 | 14 | # Create directory tree if missing? 15 | app.add_config_value('headers_mkdirs', False, '') 16 | 17 | # Suffix to tag onto file name before the '.h' extension 18 | app.add_config_value('headers_filename_sfx', '', 'html') 19 | 20 | # Header template to use 21 | app.add_config_value('headers_template', 'header.h', 'html') 22 | 23 | # Write a header when its corresponding HTML page is written. 24 | app.connect('html-page-context', writer) 25 | 26 | 27 | def writer(app, pagename, templatename, context, doctree): 28 | if doctree is None: 29 | return 30 | 31 | env = app.builder.env 32 | dirpath = os.path.abspath(app.config['headers_dest']) 33 | if app.config['headers_mkdirs'] and not os.path.lexists(dirpath): 34 | os.makedirs(dirpath) 35 | filename_suffix = app.config['headers_filename_sfx'] 36 | items = [] 37 | for section in isections(doctree): 38 | tour_descinfo(items.append, section, env) 39 | if not items: 40 | return 41 | templates = app.builder.templates 42 | filename = '%s%s.h' % (os.path.basename(pagename), filename_suffix) 43 | filepath = os.path.join(dirpath, filename) 44 | template = app.config['headers_template'] 45 | header = open(filepath, 'w') 46 | context['hdr_items'] = items 47 | try: 48 | header.write(templates.render(template, context)) 49 | finally: 50 | header.close() 51 | del context['hdr_items'] 52 | -------------------------------------------------------------------------------- /src/fastevents.h: -------------------------------------------------------------------------------- 1 | #ifndef _FASTEVENTS_H_ 2 | #define _FASTEVENTS_H_ 3 | /* 4 | NET2 is a threaded, event based, network IO library for SDL. 5 | Copyright (C) 2002 Bob Pendleton 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public License 9 | as published by the Free Software Foundation; either version 2.1 10 | of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free 19 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 20 | 02111-1307 USA 21 | 22 | If you do not wish to comply with the terms of the LGPL please 23 | contact the author as other terms are available for a fee. 24 | 25 | Bob Pendleton 26 | Bob@Pendleton.com 27 | */ 28 | 29 | #include "SDL.h" 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | int FE_Init(void); // Initialize FE 36 | void FE_Quit(void); // shutdown FE 37 | 38 | void FE_PumpEvents(void); // replacement for SDL_PumpEvents 39 | int FE_PollEvent(SDL_Event *event); // replacement for SDL_PollEvent 40 | int FE_WaitEvent(SDL_Event *event); // replacement for SDL_WaitEvent 41 | int FE_PushEvent(SDL_Event *event); // replacement for SDL_PushEvent 42 | 43 | char *FE_GetError(void); // get the last error 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /docs/reST/themes/classic/elements.html: -------------------------------------------------------------------------------- 1 | {%- extends "!layout.html" %} 2 | 3 | {%- if not theme_relbar %} 4 | {%- block relbar1 %}{# Do not want bar accross the top #}{% endblock %} 5 | {%- endif %} 6 | 7 | {#- Classic header with Snakey on the left, page links on the right. 8 | #} 9 | {%- macro header() %} 10 |
11 | 12 | 13 | 20 | 42 | 43 |
44 |
45 | {%- endmacro %} 46 | 47 | {%- block body %} 48 | {%- block section %}{% endblock %} 49 | {%- endblock %} 50 | 51 | 52 | {%- block relbaritems %} 53 | {%- set jquerydocscomments_path = '_static/jquery.plugin.docscomments.js' %} 54 | 55 | {% endblock %} 56 | -------------------------------------------------------------------------------- /test/image__save_gl_surface_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | if __name__ == '__main__': 4 | import sys 5 | pkg_dir = os.path.split(os.path.abspath(__file__))[0] 6 | parent_dir, pkg_name = os.path.split(pkg_dir) 7 | is_pygame_pkg = (pkg_name == 'tests' and 8 | os.path.split(parent_dir)[1] == 'pygame') 9 | if not is_pygame_pkg: 10 | sys.path.insert(0, parent_dir) 11 | else: 12 | is_pygame_pkg = __name__.startswith('pygame.tests.') 13 | 14 | import unittest 15 | if is_pygame_pkg: 16 | from pygame.tests import test_utils 17 | else: 18 | from test import test_utils 19 | import pygame 20 | from pygame.locals import * 21 | 22 | class GL_ImageSave(unittest.TestCase): 23 | def test_image_save_works_with_opengl_surfaces(self): 24 | "|tags:display,slow,opengl|" 25 | 26 | pygame.display.init() 27 | 28 | 29 | screen = pygame.display.set_mode((640,480), OPENGL|DOUBLEBUF) 30 | 31 | pygame.display.flip() 32 | 33 | tmp_dir = test_utils.get_tmp_dir() 34 | # Try the imageext module. 35 | tmp_file = os.path.join(tmp_dir, "opengl_save_surface_test.png") 36 | 37 | pygame.image.save(screen, tmp_file) 38 | 39 | self.assert_(os.path.exists(tmp_file)) 40 | 41 | os.remove(tmp_file) 42 | 43 | # Only test the image module. 44 | tmp_file = os.path.join(tmp_dir, "opengl_save_surface_test.bmp") 45 | 46 | pygame.image.save(screen, tmp_file) 47 | 48 | self.assert_(os.path.exists(tmp_file)) 49 | 50 | os.remove(tmp_file) 51 | 52 | # stops tonnes of tmp dirs building up in trunk dir 53 | os.rmdir(tmp_dir) 54 | 55 | 56 | pygame.display.quit() 57 | if __name__ == '__main__': 58 | unittest.main() 59 | -------------------------------------------------------------------------------- /src/doc/key_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMEKEY "pygame module to work with the keyboard" 3 | 4 | #define DOC_PYGAMEKEYGETFOCUSED "get_focused() -> bool\ntrue if the display is receiving keyboard input from the system" 5 | 6 | #define DOC_PYGAMEKEYGETPRESSED "get_pressed() -> bools\nget the state of all keyboard buttons" 7 | 8 | #define DOC_PYGAMEKEYGETMODS "get_mods() -> int\ndetermine which modifier keys are being held" 9 | 10 | #define DOC_PYGAMEKEYSETMODS "set_mods(int) -> None\ntemporarily set which modifier keys are pressed" 11 | 12 | #define DOC_PYGAMEKEYSETREPEAT "set_repeat() -> None\nset_repeat(delay, interval) -> None\ncontrol how held keys are repeated" 13 | 14 | #define DOC_PYGAMEKEYGETREPEAT "get_repeat() -> (delay, interval)\nsee how held keys are repeated" 15 | 16 | #define DOC_PYGAMEKEYNAME "name(key) -> string\nget the name of a key identifier" 17 | 18 | 19 | 20 | /* Docs in a comment... slightly easier to read. */ 21 | 22 | /* 23 | 24 | pygame.key 25 | pygame module to work with the keyboard 26 | 27 | pygame.key.get_focused 28 | get_focused() -> bool 29 | true if the display is receiving keyboard input from the system 30 | 31 | pygame.key.get_pressed 32 | get_pressed() -> bools 33 | get the state of all keyboard buttons 34 | 35 | pygame.key.get_mods 36 | get_mods() -> int 37 | determine which modifier keys are being held 38 | 39 | pygame.key.set_mods 40 | set_mods(int) -> None 41 | temporarily set which modifier keys are pressed 42 | 43 | pygame.key.set_repeat 44 | set_repeat() -> None 45 | set_repeat(delay, interval) -> None 46 | control how held keys are repeated 47 | 48 | pygame.key.get_repeat 49 | get_repeat() -> (delay, interval) 50 | see how held keys are repeated 51 | 52 | pygame.key.name 53 | name(key) -> string 54 | get the name of a key identifier 55 | 56 | */ -------------------------------------------------------------------------------- /trackmod/namereg.py: -------------------------------------------------------------------------------- 1 | # module trackmod.namereg 2 | 3 | class NameRegistry(object): 4 | 5 | class AllRegistered(object): 6 | terminal = True 7 | def register(self, names): 8 | return 9 | def __contains__(self, name): 10 | return True 11 | all_registered = AllRegistered() 12 | 13 | class AllFound(object): 14 | def __init__(self, value): 15 | self.value = value 16 | def __getitem__(self, key): 17 | return self.value 18 | all_found = AllFound(all_registered) 19 | 20 | def __init__(self, names=None): 21 | self.names = {} 22 | if names is not None: 23 | self.add(names) 24 | self.terminal = False 25 | 26 | def add(self, names): 27 | if names is None: 28 | self.terminal = True 29 | return 30 | for name in names: 31 | parts = name.split('.', 1) 32 | first = parts[0] 33 | if first == '*': 34 | self.names = self.all_found 35 | return 36 | else: 37 | try: 38 | sub_registry = self.names[first] 39 | except KeyError: 40 | sub_registry = NameRegistry() 41 | self.names[first] = sub_registry 42 | if len(parts) == 2: 43 | sub_registry.add(parts[1:]) 44 | else: 45 | sub_registry.terminal = True 46 | 47 | def __contains__(self, name): 48 | parts = name.split('.', 1) 49 | try: 50 | sub_registry = self.names[parts[0]] 51 | except KeyError: 52 | return False 53 | # This uses a conditional or. 54 | if len(parts) == 1: 55 | return sub_registry.terminal 56 | return parts[1] in sub_registry 57 | 58 | -------------------------------------------------------------------------------- /.travis_osx_upload_whl.py: -------------------------------------------------------------------------------- 1 | """ Uploads wheels to pypi from travisci. 2 | 3 | The commit requires an UPLOAD line. 4 | """ 5 | import glob 6 | import os 7 | import subprocess 8 | import sys 9 | 10 | 11 | def write_config(): 12 | """ 13 | # Set these inside travis. Note, it is on a per repo basis. 14 | # https://docs.travis-ci.com/user/environment-variables/#Encrypting-Variables-Using-a-Public-Key 15 | # travis encrypt PYPI_USERNAME=super_secret --add 16 | # travis encrypt PYPI_PASSWD=super_secret --add 17 | """ 18 | if not os.environ.get('PYPI_USERNAME', None): 19 | return 20 | 21 | username = os.environ['PYPI_USERNAME'] 22 | password = os.environ['PYPI_PASSWD'] 23 | 24 | pypirc_template = """\ 25 | [distutils] 26 | index-servers = 27 | pypi 28 | [pypi] 29 | repository: https://upload.pypi.io/legacy/ 30 | username: {username} 31 | password: {password} 32 | """.format(username=username, password=password) 33 | 34 | with open('pypirc', 'w') as afile: 35 | afile.write(pypirc_template) 36 | 37 | if '--write-config' in sys.argv: 38 | write_config() 39 | sys.exit(0) 40 | else: 41 | if '--no-config' not in sys.argv: 42 | write_config() 43 | 44 | # if --no-git we do not check with git if an upload is needed. 45 | do_git_check = '--no-git' not in sys.argv 46 | if do_git_check: 47 | commit = subprocess.check_output(['git', 'log', '-1']) 48 | print(commit) 49 | if b'UPLOAD' not in commit: 50 | print('Not uploading') 51 | sys.exit(0) 52 | 53 | # There should be exactly one .whl 54 | filenames = glob.glob('dist/*.whl') 55 | 56 | 57 | print('Calling twine to upload...') 58 | try: 59 | for filename in filenames: 60 | cmd = ['twine', 'upload', '--config-file', 'pypirc', filename] 61 | print(' '.join(cmd)) 62 | subprocess.check_call(cmd) 63 | except: 64 | print('is twine installed?') 65 | finally: 66 | os.unlink('pypirc') 67 | -------------------------------------------------------------------------------- /test/fixtures/fonts/PyGameMono-8.bdf: -------------------------------------------------------------------------------- 1 | STARTFONT 2.1 2 | FONT -FontForge-PyGameMono-Medium-R-Normal--8-80-75-75-C-80-ISO10646-1 3 | SIZE 8 75 75 4 | FONTBOUNDINGBOX 6 7 0 0 5 | COMMENT "Generated by fontforge, http://fontforge.sourceforge.net" 6 | COMMENT "Created by Lenard Lindstrom,,, with FontForge 2.0 (http://fontforge.sf.net)" 7 | STARTPROPERTIES 29 8 | FOUNDRY "FontForge" 9 | FAMILY_NAME "PyGameMono" 10 | WEIGHT_NAME "Medium" 11 | SLANT "R" 12 | SETWIDTH_NAME "Normal" 13 | ADD_STYLE_NAME "" 14 | PIXEL_SIZE 8 15 | POINT_SIZE 80 16 | RESOLUTION_X 75 17 | RESOLUTION_Y 75 18 | SPACING "C" 19 | AVERAGE_WIDTH 80 20 | CHARSET_REGISTRY "ISO10646" 21 | CHARSET_ENCODING "1" 22 | FONTNAME_REGISTRY "" 23 | CHARSET_COLLECTIONS "ISO10646-1" 24 | FONT_NAME "PyGameMono" 25 | FACE_NAME "PyGame Mono" 26 | FONT_VERSION "001.000" 27 | FONT_ASCENT 6 28 | FONT_DESCENT 2 29 | UNDERLINE_POSITION -1 30 | UNDERLINE_THICKNESS 1 31 | RAW_ASCENT 800 32 | RAW_DESCENT 200 33 | RELATIVE_WEIGHT 50 34 | RELATIVE_SETWIDTH 50 35 | FIGURE_WIDTH -1 36 | AVG_UPPERCASE_WIDTH 80 37 | ENDPROPERTIES 38 | CHARS 5 39 | STARTCHAR .notdef 40 | ENCODING 0 41 | SWIDTH 1000 0 42 | DWIDTH 8 0 43 | BBX 6 6 0 0 44 | BITMAP 45 | FC 46 | 84 47 | 84 48 | 84 49 | 84 50 | FC 51 | ENDCHAR 52 | STARTCHAR A 53 | ENCODING 65 54 | SWIDTH 1000 0 55 | DWIDTH 8 0 56 | BBX 6 7 0 0 57 | BITMAP 58 | 78 59 | 84 60 | 84 61 | FC 62 | 84 63 | 84 64 | 84 65 | ENDCHAR 66 | STARTCHAR B 67 | ENCODING 66 68 | SWIDTH 1000 0 69 | DWIDTH 8 0 70 | BBX 6 6 0 0 71 | BITMAP 72 | FC 73 | 44 74 | 78 75 | 4C 76 | 44 77 | FC 78 | ENDCHAR 79 | STARTCHAR C 80 | ENCODING 67 81 | SWIDTH 1000 0 82 | DWIDTH 8 0 83 | BBX 6 6 0 0 84 | BITMAP 85 | 78 86 | C4 87 | C0 88 | C0 89 | C4 90 | 78 91 | ENDCHAR 92 | STARTCHAR u13079 93 | ENCODING 77945 94 | SWIDTH 1000 0 95 | DWIDTH 8 0 96 | BBX 6 4 0 1 97 | BITMAP 98 | 78 99 | B4 100 | B4 101 | 78 102 | ENDCHAR 103 | ENDFONT 104 | -------------------------------------------------------------------------------- /symbian/configure.py: -------------------------------------------------------------------------------- 1 | """ Script to configure build_config.py 2 | 3 | == Build everything, including pys60 == 4 | configure.py pys60_ce_src=\projects\pys60ce\trunk\src 5 | 6 | == Use existing python sis == 7 | configure.py build_python=False pys60_sis=python.sisx pythondll=python222.dll 8 | 9 | """ 10 | 11 | import os, sys 12 | 13 | def start(): 14 | 15 | try: 16 | import build_config as defaults 17 | except: 18 | import default_build_config as defaults 19 | 20 | args = [x.split("=") for x in sys.argv if "=" in x] 21 | 22 | vars = [ x for x in dir(defaults) if not x.startswith("_") ] 23 | values = [ getattr( defaults, x ) for x in vars ] 24 | oldvalues = zip( vars, values ) 25 | 26 | print "=" * 79 27 | result = {} 28 | for name,value in args: 29 | if name not in vars: 30 | print "Error: no such configuration '%s'" % name 31 | print "Possible configuration values are:\n", " | ".join( vars ) 32 | raise SystemExit( ) 33 | 34 | old = getattr(defaults, name ) 35 | try: 36 | # Evaluate booleans and integers 37 | result[name] = eval(value) 38 | except: 39 | result[name] = value 40 | 41 | print name, "reconfigured '%s' => '%s'" % ( str(old), str( value )) 42 | 43 | for name, value in oldvalues: 44 | if name not in result: 45 | result[name] = value 46 | 47 | 48 | # Create the module 49 | print 50 | print "-" * 79 51 | f=open("build_config.py",'w'); 52 | keys = result.keys();keys.sort() 53 | for name in keys: 54 | value = result[name] 55 | line = "%-15s = %s\n" % ( name, repr(value)) 56 | print line.strip() 57 | f.write(line) 58 | f.close() 59 | 60 | print "=" * 79 61 | 62 | if __name__ == "__main__": 63 | start() 64 | -------------------------------------------------------------------------------- /test/util/build_page/upload_results/index.py: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | """:" 3 | PYTHONPATH=/home/wazoocom/www/pygame/libs exec /home/wazoocom/bin/python $0 ${1+"$@"} 4 | """ 5 | 6 | ################################################################################ 7 | 8 | # Std Libs 9 | import os 10 | 11 | # User Libs 12 | from pywebsite import * 13 | from helpers import relative_to, ResultsZip 14 | 15 | import process_results 16 | 17 | ################################################################################ 18 | 19 | def prepare_results_dirs(d): 20 | archives_dir = os.path.join(d, 'archives') 21 | db_dir = os.path.join(d, 'db') 22 | 23 | for dir in (archives_dir, db_dir): 24 | if not os.path.exists(dir): 25 | os.makedirs(dir) 26 | 27 | ################################################################################ 28 | 29 | q = cgi.FieldStorage() 30 | 31 | if q.has_key('results_file'): 32 | rz = ResultsZip(q['results_file'].file) 33 | 34 | results_dir = relative_to(__file__, '../results/%s' % rz.platform_id) 35 | prepare_results_dirs(results_dir) 36 | 37 | if 'test_results_dict.txt' in rz.namelist(): 38 | db = ZDB(os.path.join(results_dir, 'db', '%s.fs' % rz.platform_id)) 39 | db.root[rz.latest_rev] = rz.eval('test_results_dict.txt') 40 | db.close() 41 | 42 | process_results.process_zip(rz, results_dir) 43 | 44 | rz.close() 45 | 46 | print '%s RESULTS UPLOAD SUCCESSFUL' % rz.platform_id.upper() 47 | else: 48 | print """ 49 | 50 | 51 | Testing 52 | 53 | 54 | 55 |
56 | 57 | 58 | Send this file: 59 | 60 | 61 |
62 | 63 | 64 | 65 | """ 66 | 67 | ################################################################################ -------------------------------------------------------------------------------- /src/font.h: -------------------------------------------------------------------------------- 1 | /* 2 | pygame - Python Game Library 3 | Copyright (C) 2000-2001 Pete Shinners 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | Pete Shinners 20 | pete@shinners.org 21 | */ 22 | 23 | #include 24 | #if defined(HAVE_SNPRINTF) /* also defined in SDL_ttf (SDL.h) */ 25 | #undef HAVE_SNPRINTF /* remove GCC macro redefine warning */ 26 | #endif 27 | #include 28 | 29 | 30 | /* test font initialization */ 31 | #define FONT_INIT_CHECK() \ 32 | if(!(*(int*)PyFONT_C_API[2])) \ 33 | return RAISE(PyExc_SDLError, "font system not initialized") 34 | 35 | 36 | 37 | #define PYGAMEAPI_FONT_FIRSTSLOT 0 38 | #define PYGAMEAPI_FONT_NUMSLOTS 3 39 | typedef struct { 40 | PyObject_HEAD 41 | TTF_Font* font; 42 | PyObject* weakreflist; 43 | } PyFontObject; 44 | #define PyFont_AsFont(x) (((PyFontObject*)x)->font) 45 | 46 | #ifndef PYGAMEAPI_FONT_INTERNAL 47 | #define PyFont_Check(x) ((x)->ob_type == (PyTypeObject*)PyFONT_C_API[0]) 48 | #define PyFont_Type (*(PyTypeObject*)PyFONT_C_API[0]) 49 | #define PyFont_New (*(PyObject*(*)(TTF_Font*))PyFONT_C_API[1]) 50 | /*slot 2 taken by FONT_INIT_CHECK*/ 51 | 52 | #define import_pygame_font() \ 53 | _IMPORT_PYGAME_MODULE(font, FONT, PyFONT_C_API) 54 | 55 | static void* PyFONT_C_API[PYGAMEAPI_FONT_NUMSLOTS] = {NULL}; 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /src/doc/mouse_doc.h: -------------------------------------------------------------------------------- 1 | /* Auto generated file: with makeref.py . Docs go in src/ *.doc . */ 2 | #define DOC_PYGAMEMOUSE "pygame module to work with the mouse" 3 | 4 | #define DOC_PYGAMEMOUSEGETPRESSED "get_pressed() -> (button1, button2, button3)\nget the state of the mouse buttons" 5 | 6 | #define DOC_PYGAMEMOUSEGETPOS "get_pos() -> (x, y)\nget the mouse cursor position" 7 | 8 | #define DOC_PYGAMEMOUSEGETREL "get_rel() -> (x, y)\nget the amount of mouse movement" 9 | 10 | #define DOC_PYGAMEMOUSESETPOS "set_pos([x, y]) -> None\nset the mouse cursor position" 11 | 12 | #define DOC_PYGAMEMOUSESETVISIBLE "set_visible(bool) -> bool\nhide or show the mouse cursor" 13 | 14 | #define DOC_PYGAMEMOUSEGETFOCUSED "get_focused() -> bool\ncheck if the display is receiving mouse input" 15 | 16 | #define DOC_PYGAMEMOUSESETCURSOR "set_cursor(size, hotspot, xormasks, andmasks) -> None\nset the image for the system mouse cursor" 17 | 18 | #define DOC_PYGAMEMOUSEGETCURSOR "get_cursor() -> (size, hotspot, xormasks, andmasks)\nget the image for the system mouse cursor" 19 | 20 | 21 | 22 | /* Docs in a comment... slightly easier to read. */ 23 | 24 | /* 25 | 26 | pygame.mouse 27 | pygame module to work with the mouse 28 | 29 | pygame.mouse.get_pressed 30 | get_pressed() -> (button1, button2, button3) 31 | get the state of the mouse buttons 32 | 33 | pygame.mouse.get_pos 34 | get_pos() -> (x, y) 35 | get the mouse cursor position 36 | 37 | pygame.mouse.get_rel 38 | get_rel() -> (x, y) 39 | get the amount of mouse movement 40 | 41 | pygame.mouse.set_pos 42 | set_pos([x, y]) -> None 43 | set the mouse cursor position 44 | 45 | pygame.mouse.set_visible 46 | set_visible(bool) -> bool 47 | hide or show the mouse cursor 48 | 49 | pygame.mouse.get_focused 50 | get_focused() -> bool 51 | check if the display is receiving mouse input 52 | 53 | pygame.mouse.set_cursor 54 | set_cursor(size, hotspot, xormasks, andmasks) -> None 55 | set the image for the system mouse cursor 56 | 57 | pygame.mouse.get_cursor 58 | get_cursor() -> (size, hotspot, xormasks, andmasks) 59 | get the image for the system mouse cursor 60 | 61 | */ -------------------------------------------------------------------------------- /distutils_mods.py: -------------------------------------------------------------------------------- 1 | #purpose: a few changes to distutils to build betterer. 2 | # - fixes up paths when using msys. 3 | # 4 | # 5 | 6 | import os 7 | 8 | import distutils.cygwinccompiler 9 | distutils.cygwinccompiler.oldMingw32CCompiler= distutils.cygwinccompiler.Mingw32CCompiler 10 | """ 11 | Should put the above imports at the top of your file. 12 | and after them put 13 | 14 | import distutils_mods 15 | distutils.cygwinccompiler.Mingw32 = distutils_mods.mingcomp 16 | 17 | """ 18 | 19 | from distutils.errors import DistutilsExecError 20 | 21 | 22 | class mingcomp(distutils.cygwinccompiler.oldMingw32CCompiler): 23 | 24 | def spawn(self, cmd): 25 | """ Because spawn uses a straight call to the systems underlying 26 | shell, bypassing the string handling goodness of mingw/msys 27 | something gets fubared. So this little hack method was put 28 | in its place. 29 | """ 30 | self.verbose = 1 31 | if self.verbose: 32 | print "cmd :%s:" % cmd 33 | 34 | cmpl = " ".join(cmd) 35 | cmpl = cmpl.replace("\\", "/") 36 | cmpl = cmpl.replace("c:", "/c") 37 | cmpl = cmpl.replace("C:", "/c") 38 | cmpl = cmpl.replace("gcc", "gcc -g ") 39 | 40 | if self.verbose: 41 | print "cmpl is :%s:" % cmpl 42 | 43 | if not self.dry_run: 44 | import tempfile 45 | tmpfn = tempfile.mktemp(suffix='run_compiler') 46 | tmpf = open(tmpfn, "w+b") 47 | tmpf.write(cmpl) 48 | tmpf.close() 49 | r = os.system("sh %s" % tmpfn) 50 | 51 | os.remove(tmpfn) 52 | if r != 0: 53 | raise DistutilsExecError, \ 54 | "command '%s' failed with exit status :%d: command was :%s:. " % (cmd[0], r, cmpl) 55 | 56 | if self.verbose: 57 | print "return value of the compile command is :%s:" % r 58 | 59 | 60 | 61 | 62 | distutils.cygwinccompiler.Mingw32CCompiler= mingcomp 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | --------------------------------------------------------------------------------