"SURFAR~1.PYD|surfarray.pyd", prop, 1),
"SNDARRAY.PYD|sndarray.pyd", prop, 1),
+ ("camera.pyd", comp, "CAMERA.PYD|camera.pyd", prop, 1),
("color.py", comp, "COLOR.PY|color.py", prop, 1),
("color.pyc", comp, "COLOR.PYC|color.pyc", prop, 1),
("color.pyo", comp, "COLOR.PYO|color.pyo", prop, 1)]
# test command. For doing 'python setup.py test'
+ # try and figure out where we are installed.
+ #pygame could be installed in a weird location because of
+ # setuptools or something else. The only sane way seems to be by trying
+ # first to import it, and see where the imported one is.
+ # Otherwise we might delete some files from another installation.
+ install_path= os.path.split(pygame.base.__file__)
+ extension_ext = os.path.splitext(pygame.base.__file__)
+ if not os.path.exists(data_path):
+ install_path = data_path
+ base_file = glob.glob(os.path.join(data_path, "base*"))
+ extension_ext = os.path.splitext(base_file)
+ # here are the .so/.pyd files we need to ask to remove.
+ ext_to_remove = ["camera"]
+ # here are the .py/.pyo/.pyc files we need to ask to remove.
+ py_to_remove = ["color"]
+ os.path.join(data_path, 'color.py')
+ if os.name == "e32": # Don't warn on Symbian. The color.py is used as a wrapper.
+ # See if any of the files are there.
+ extension_files = ["%s%s" % (x, extension_ext) for x in ext_to_remove]
+ py_files = ["%s%s" % (x, py_ext)
+ for py_ext in [".py", ".pyc", ".pyo"]
+ files = py_files + extension_files
+ unwanted_files.append( os.path.join( install_path, f ) )
+ for f in unwanted_files:
+ print("trying to remove old file :%s: ..." %f)
+ print("Successfully removed :%s:." % f)
+ print("FAILED to remove old file :%s:" % f)
+if "install" in sys.argv:
+ # remove some old files.
+ # only call after a successful install. Should only reach here if there is
+ # a successful install... otherwise setup() raises an error.