rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
"""Same as for the pygame.sprite.Group.
"""initialize group.
def __init__(self, *sprites, **kwargs): """Same as for the pygame.sprite.Group. pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty
_use_update: True/False default is False _default_layer: the default layer where the sprites without a layer are added. _time_threshold: treshold time for switching between dirty rect mode and fullscreen mode, defaults to 1000./80 == 1000./fps
_use_update: True/False (default is False) _default_layer: default layer where the sprites without a layer are added _time_threshold: treshold time for switching between dirty rect mode and fullscreen mode; defaults to updating at 80 frames per second, which is equal to 1000.0 / 80.0
def __init__(self, *sprites, **kwargs): """Same as for the pygame.sprite.Group. pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty
self._time_threshold = 1000./80.
self._time_threshold = 1000.0 / 80.0
def __init__(self, *sprites, **kwargs): """Same as for the pygame.sprite.Group. pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty
"""draw all sprites in the right order onto the passed surface.
"""draw all sprites in the right order onto the given surface
def draw(self, surface, bgd=None): """draw all sprites in the right order onto the passed surface. LayeredDirty.draw(surface, bgd=None): return Rect_list
You can pass the background too. If a background is already set, then the bgd argument has no effect.
You can pass the background too. If a self.bgd is already set to some value that is not None, then the bgd argument has no effect.
def draw(self, surface, bgd=None): """draw all sprites in the right order onto the passed surface. LayeredDirty.draw(surface, bgd=None): return Rect_list
_surf_blit(spr.image, clip, \ (clip[0]-_spr_rect[0], \ clip[1]-_spr_rect[1], \ clip[2], \ clip[3]), spr.blendmode)
_surf_blit(spr.image, clip, (clip[0] - _spr_rect[0], clip[1] - _spr_rect[1], clip[2], clip[3]), spr.blendmode)
def draw(self, surface, bgd=None): """draw all sprites in the right order onto the passed surface. LayeredDirty.draw(surface, bgd=None): return Rect_list
_old_rect[spr] = _surf_blit(spr.image, spr.rect, \ spr.source_rect, spr.blendmode)
_old_rect[spr] = _surf_blit(spr.image, spr.rect, spr.source_rect, spr.blendmode)
def draw(self, surface, bgd=None): """draw all sprites in the right order onto the passed surface. LayeredDirty.draw(surface, bgd=None): return Rect_list
"""used to set background
"""use to set background
def clear(self, surface, bgd): """used to set background Group.clear(surface, bgd): return None """ self._bgd = bgd
def repaint_rect(self, screen_rect): """repaints the given area
def repaint_rect(self, screen_rect): """repaint the given area
def repaint_rect(self, screen_rect): """repaints the given area LayeredDirty.repaint_rect(screen_rect): return None
""" clip the area where to draw. Just pass None (default) to reset the clip
"""clip the area where to draw; pass None (default) to reset the clip
def set_clip(self, screen_rect=None): """ clip the area where to draw. Just pass None (default) to reset the clip LayeredDirty.set_clip(screen_rect=None): return None """ if screen_rect is None: self._clip = pygame.display.get_surface().get_rect() else: self._clip = screen_rect self._use_update = False
"""clip the area where to draw. Just pass None (default) to reset the clip
"""get the area where drawing will occur
def get_clip(self): """clip the area where to draw. Just pass None (default) to reset the clip LayeredDirty.get_clip(): return Rect """ return self._clip
"""changes the layer of the sprite change_layer(sprite, new_layer): return None sprite must have been added to the renderer. It is not checked.
"""change the layer of the sprite LayeredUpdates.change_layer(sprite, new_layer): return None The sprite must have been added to the renderer already. This is not checked.
def change_layer(self, sprite, new_layer): """changes the layer of the sprite change_layer(sprite, new_layer): return None
"""sets the treshold in milliseconds
"""set the treshold in milliseconds
def set_timing_treshold(self, time_ms): """sets the treshold in milliseconds set_timing_treshold(time_ms): return None
Default is 1000./80 where 80 is the fps I want to switch to full screen mode.
Defaults to 1000.0 / 80.0. This means that the screen will be painted using the flip method rather than the update method if the update method is taking so long to update the screen that the frame rate falls below 80 frames per second.
def set_timing_treshold(self, time_ms): """sets the treshold in milliseconds set_timing_treshold(time_ms): return None
This class works just like a regular group, but it only keeps a single sprite in the group. Whatever sprite has been added to the group last, will be the only sprite in the group. You can access its one sprite as the .sprite attribute. Assigning to this attribute will properly remove the old sprite and then add the ne...
This class works just like a regular group, but it only keeps a single sprite in the group. Whatever sprite has been added to the group last will be the only sprite in the group. You can access its one sprite as the .sprite attribute. Assigning to this attribute will properly remove the old sprite and then add the ne...
def set_timing_treshold(self, time_ms): """sets the treshold in milliseconds set_timing_treshold(time_ms): return None
return (self.__sprite is sprite)
return self.__sprite is sprite
def has_internal(self, sprite): return (self.__sprite is sprite)
def __contains__(self, sprite): return (self.__sprite is sprite)
def __contains__(self, sprite): return self.__sprite is sprite
def __contains__(self, sprite): return (self.__sprite is sprite)
Tests for collision between two sprites. Uses the pygame rect colliderect function to calculate the collision. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" attributes.
Tests for collision between two sprites. Uses the pygame.Rect colliderect function to calculate the collision. It is intended to be passed as a collided callback function to the *collide functions. Sprites must have "rect" attributes.
def collide_rect(left, right): """collision detection between two sprites, using rects. pygame.sprite.collide_rect(left, right): return bool Tests for collision between two sprites. Uses the pygame rect colliderect function to calculate the collision. Intended to be passed as a collided callback function to the *colli...
"""A callable class that checks for collisions between two sprites, using a scaled version of the sprites rects. Is created with a ratio, the instance is then intended to be passed as a collided callback function to the *collide functions.
"""A callable class that checks for collisions using scaled rects The class checks for collisions between two sprites using a scaled version of the sprites' rects. Is created with a ratio; the instance is then intended to be passed as a collided callback function to the *collide functions.
def collide_rect(left, right): """collision detection between two sprites, using rects. pygame.sprite.collide_rect(left, right): return bool Tests for collision between two sprites. Uses the pygame rect colliderect function to calculate the collision. Intended to be passed as a collided callback function to the *colli...
Creates a new collide_rect_ratio callable. ratio is expected to be a floating point value used to scale the underlying sprite rect before checking for collisions. """
create a new collide_rect_ratio callable Ratio is expected to be a floating point value used to scale the underlying sprite rect before checking for collisions. """
def collide_rect(left, right): """collision detection between two sprites, using rects. pygame.sprite.collide_rect(left, right): return bool Tests for collision between two sprites. Uses the pygame rect colliderect function to calculate the collision. Intended to be passed as a collided callback function to the *colli...
def __call__( self, left, right ): """pygame.sprite.collide_rect_ratio(ratio)(left, right): bool collision detection between two sprites, using scaled rects. Tests for collision between two sprites. Uses the pygame rect colliderect function to calculate the collision, after scaling the rects by the stored ratio. Sprit...
def __call__(self, left, right): """detect collision between two sprites using scaled rects pygame.sprite.collide_rect_ratio(ratio)(left, right): return bool Tests for collision between two sprites. Uses the pygame.Rect colliderect function to calculate the collision after scaling the rects by the stored ratio. Sprit...
def __call__( self, left, right ): """pygame.sprite.collide_rect_ratio(ratio)(left, right): bool collision detection between two sprites, using scaled rects.
"""collision detection between two sprites, using circles.
"""detect collision between two sprites using circles
def collide_circle( left, right ): """collision detection between two sprites, using circles. pygame.sprite.collide_circle(left, right): return bool Tests for collision between two sprites, by testing to see if two circles centered on the sprites overlap. If the sprites have a "radius" attribute, that is used to creat...
Tests for collision between two sprites, by testing to see if two circles centered on the sprites overlap. If the sprites have a "radius" attribute, that is used to create the circle, otherwise a circle is created that is big enough to completely enclose the sprites rect as given by the "rect" attribute. Intended to be...
Tests for collision between two sprites by testing whether two circles centered on the sprites overlap. If the sprites have a "radius" attribute, then that radius is used to create the circle; otherwise, a circle is created that is big enough to completely enclose the sprite's rect as given by the "rect" attribute. Thi...
def collide_circle( left, right ): """collision detection between two sprites, using circles. pygame.sprite.collide_circle(left, right): return bool Tests for collision between two sprites, by testing to see if two circles centered on the sprites overlap. If the sprites have a "radius" attribute, that is used to creat...
class collide_circle_ratio( object ): """A callable class that checks for collisions between two sprites, using a scaled version of the sprites radius. Is created with a ratio, the instance is then intended to be passed as a collided callback function to the *collide functions.
class collide_circle_ratio(object): """detect collision between two sprites using scaled circles This callable class checks for collisions between two sprites using a scaled version of a sprite's radius. It is created with a ratio as the argument to the constructor. The instance is then intended to be passed as a coll...
def collide_circle( left, right ): """collision detection between two sprites, using circles. pygame.sprite.collide_circle(left, right): return bool Tests for collision between two sprites, by testing to see if two circles centered on the sprites overlap. If the sprites have a "radius" attribute, that is used to creat...
Creates a new collide_circle_ratio callable. ratio is expected to be a floating point value used to scale the underlying sprite radius before checking for collisions.
creates a new collide_circle_ratio callable instance The given ratio is expected to be a floating point value used to scale the underlying sprite radius before checking for collisions.
def collide_circle( left, right ): """collision detection between two sprites, using circles. pygame.sprite.collide_circle(left, right): return bool Tests for collision between two sprites, by testing to see if two circles centered on the sprites overlap. If the sprites have a "radius" attribute, that is used to creat...
"""pygame.sprite.collide_circle_radio(ratio)(left, right): return bool collision detection between two sprites, using scaled circles. Tests for collision between two sprites, by testing to see if two circles centered on the sprites overlap, after scaling the circles radius by the stored ratio. If the sprites have a "r...
"""detect collision between two sprites using scaled circles pygame.sprite.collide_circle_radio(ratio)(left, right): return bool Tests for collision between two sprites by testing whether two circles centered on the sprites overlap after scaling the circle's radius by the stored ratio. If the sprites have a "radius" ...
def __call__( self, left, right ): """pygame.sprite.collide_circle_radio(ratio)(left, right): return bool collision detection between two sprites, using scaled circles.
Tests for collision between two sprites, by testing if thier bitmasks overlap. If the sprites have a "mask" attribute, that is used as the mask, otherwise a mask is created from the sprite image. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional ...
Tests for collision between two sprites by testing if their bitmasks overlap. If the sprites have a "mask" attribute, that is used as the mask; otherwise, a mask is created from the sprite image. Intended to be passed as a collided callback function to the *collide functions. Sprites must have a "rect" and an optional ...
def collide_mask(left, right): """collision detection between two sprites, using masks. pygame.sprite.collide_mask(SpriteLeft, SpriteRight): bool Tests for collision between two sprites, by testing if thier bitmasks overlap. If the sprites have a "mask" attribute, that is used as the mask, otherwise a mask is created ...
def groupcollide(groupa, groupb, dokilla, dokillb, collided = None): """pygame.sprite.groupcollide(groupa, groupb, dokilla, dokillb) -> dict collision detection between group and group given two groups, this will find the intersections between all sprites in each group. it returns a dictionary of all sprites in the fi...
def groupcollide(groupa, groupb, dokilla, dokillb, collided=None): """detect collision between a group and another group pygame.sprite.groupcollide(groupa, groupb, dokilla, dokillb): return dict Given two groups, this will find the intersections between all sprites in each group. It returns a dictionary of all sprite...
def groupcollide(groupa, groupb, dokilla, dokillb, collided = None): """pygame.sprite.groupcollide(groupa, groupb, dokilla, dokillb) -> dict collision detection between group and group given two groups, this will find the intersections between all sprites in each group. it returns a dictionary of all sprites in the fi...
buffer[c_read.value] = ctypes.c_char(0)
buffer[c_read.value] = null_byte
def ReadFile(handle, desired_bytes, ol = None): c_read = DWORD() buffer = ctypes.create_string_buffer(desired_bytes+1) success = ctypes.windll.kernel32.ReadFile(handle, buffer, desired_bytes, ctypes.byref(c_read), ol) buffer[c_read.value] = ctypes.c_char(0) return ctypes.windll.kernel32.GetLastError(), decode(buffer.va...
buffer[c_read.value] = ctypes.c_char(0)
buffer[c_read.value] = null_byte
def PeekNamedPipe(handle, desired_bytes): c_avail = DWORD() c_message = DWORD() if desired_bytes > 0: c_read = DWORD() buffer = ctypes.create_string_buffer(desired_bytes+1) success = ctypes.windll.kernel32.PeekNamedPipe(handle, buffer, desired_bytes, ctypes.byref(c_read), ctypes.byref(c_avail), ctypes.byref(c_message))...
class BuildError(StandardError):
class BuildError(Exception):
def merge_strings(*args, **kwds): """Returns non empty string joined by sep The default separator is an empty string. """ sep = kwds.get('sep', '') return sep.join([s for s in args if s])
msys_root = msys.msys_root destination_dir = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir) environ['BDBIN'] = '/usr/local/bin' environ['BDLIB'] = '/usr/local/lib' subsystem = '-mwindows' if options.console: subsystem = '-mconsole'
msys_root_wp = msys.msys_root destination_dir_wp = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir_wp) source_mp = default_source_mp if options.source_directory: source_mp = msys.windows_to_msys(options.source_directory) environ['BDBIN'] = source_mp + '/bin' environ['BDLI...
def set_environment_variables(msys, options): """Set the environment variables used by the scripts""" environ = msys.environ msys_root = msys.msys_root destination_dir = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir) environ['BDBIN'] = '/usr/local/bin' environ['BDLIB']...
environ['LDFLAGS'] = merge_strings(environ.get('LDFLAGS', ''), subsystem, strip,
environ['LDFLAGS'] = merge_strings(strip, environ.get('LDFLAGS', ''),
def set_environment_variables(msys, options): """Set the environment variables used by the scripts""" environ = msys.environ msys_root = msys.msys_root destination_dir = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir) environ['BDBIN'] = '/usr/local/bin' environ['BDLIB']...
library_path = os.path.join(msys_root, 'local', 'lib') msvcr90_path = os.path.join(destination_dir, 'msvcr90') environ['DBMSVCR90'] = msys.windows_to_msys(msvcr90_path)
msvcr90_wp = os.path.join(destination_dir_wp, 'msvcr90') environ['DBMSVCR90'] = msys.windows_to_msys(msvcr90_wp)
def set_environment_variables(msys, options): """Set the environment variables used by the scripts""" environ = msys.environ msys_root = msys.msys_root destination_dir = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir) environ['BDBIN'] = '/usr/local/bin' environ['BDLIB']...
environ['LIBRARY_PATH'] = merge_strings(msvcr90_path,
environ['LIBRARY_PATH'] = merge_strings(msvcr90_wp,
def set_environment_variables(msys, options): """Set the environment variables used by the scripts""" environ = msys.environ msys_root = msys.msys_root destination_dir = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir) environ['BDBIN'] = '/usr/local/bin' environ['BDLIB']...
class ChooseError(StandardError):
class ChooseError(Exception):
def set_environment_variables(msys, options): """Set the environment variables used by the scripts""" environ = msys.environ msys_root = msys.msys_root destination_dir = os.path.abspath(options.destination_dir) environ['BDWD'] = msys.windows_to_msys(destination_dir) environ['BDBIN'] = '/usr/local/bin' environ['BDLIB']...
except ChooseError, e: print_(e)
except ChooseError: print_(geterror())
def main(dependencies, msvcr90_preparation, msys_preparation): """Build the dependencies according to the command line options.""" options, args = command_line() if options.arg_help: print_("These are the Pygame library dependencies:") for dep in dependencies: print_(" ", dep.name) return 0 try: chosen_deps = choose_d...
except msys.MsysException, e: print_(e)
except msys.MsysException: print_(geterror())
def main(dependencies, msvcr90_preparation, msys_preparation): """Build the dependencies according to the command line options.""" options, args = command_line() if options.arg_help: print_("These are the Pygame library dependencies:") for dep in dependencies: print_(" ", dep.name) return 0 try: chosen_deps = choose_d...
except BuildError, e: print_("Build aborted:", e)
except BuildError: print_("Build aborted:", geterror())
def main(dependencies, msvcr90_preparation, msys_preparation): """Build the dependencies according to the command line options.""" options, args = command_line() if options.arg_help: print_("These are the Pygame library dependencies:") for dep in dependencies: print_(" ", dep.name) return 0 try: chosen_deps = choose_d...
gcc -shared $LDFLAGS -o SDL.dll -def SDL.def "$BDLIB/libSDL.a" -lwinmm -ldxguid
gcc -shared $LDFLAGS -mwindows -def SDL.def "$BDLIB/libSDL.a" -lwinmm -ldxguid -lgdi32 -o SDL.dll
gcc -shared $LDFLAGS -o SDL.dll -def SDL.def "$BDLIB/libSDL.a" -lwinmm -ldxguid
strip --strip-all SDL.dll
dlltool -D SDL.dll -d SDL.def -l libSDL.dll.a
gcc -shared $LDFLAGS -o zlib1.dll -def z.def "$BDLIB/libz.a"
gcc -shared $LDFLAGS -def z.def "$BDLIB/libz.a" -mwindows -o zlib1.dll
gcc -shared $LDFLAGS -o zlib1.dll -def z.def "$BDLIB/libz.a"
strip --strip-all zlib1.dll
dlltool -D zlib1.dll -d z.def -l libz.dll.a
gcc -shared $LDFLAGS -L. -o libfreetype-6.dll -def freetype.def \ "$BDLIB/libfreetype.a" -lz
gcc -shared $LDFLAGS -L. -def freetype.def \ "$BDLIB/libfreetype.a" -mwindows -lz -o libfreetype-6.dll
gcc -shared $LDFLAGS -L. -o libfreetype-6.dll -def freetype.def \ "$BDLIB/libfreetype.a" -lz
strip --strip-all libfreetype-6.dll
dlltool -D libfreetype-6.dll -d freetype.def -l libfreetype.dll.a
gcc -shared $LDFLAGS -L. "-L$BDLIB" -o SDL_ttf.dll -def SDL_ttf.def \ "$BDLIB/libSDL_ttf.a" -lSDL -lfreetype
gcc -shared $LDFLAGS -L. "-L$BDLIB" -def SDL_ttf.def \ "$BDLIB/libSDL_ttf.a" -mwindows -lSDL -lfreetype -o SDL_ttf.dll
gcc -shared $LDFLAGS -L. "-L$BDLIB" -o SDL_ttf.dll -def SDL_ttf.def \ "$BDLIB/libSDL_ttf.a" -lSDL -lfreetype
strip --strip-all SDL_ttf.dll
dlltool -D SDL_ttf.dll -d SDL_ttf.def -l libSDL_ttf.dll.a
gcc -shared $LDFLAGS -L. -o libpng14.dll -def png.def "$BDLIB/libpng.a" -lz
gcc -shared $LDFLAGS -L. -def png.def "$BDLIB/libpng.a" -mwindows -lz -o libpng14.dll
gcc -shared $LDFLAGS -L. -o libpng14.dll -def png.def "$BDLIB/libpng.a" -lz
strip --strip-all libpng14.dll
dlltool -D libpng14.dll -d png.def -l libpng.dll.a
gcc -shared $LDFLAGS -o libjpeg-8.dll -def jpeg.def "$BDLIB/libjpeg.a"
gcc -shared $LDFLAGS -def jpeg.def "$BDLIB/libjpeg.a" -mwindows -o libjpeg-8.dll
gcc -shared $LDFLAGS -o libjpeg-8.dll -def jpeg.def "$BDLIB/libjpeg.a"
strip --strip-all libjpeg-8.dll
dlltool -D libjpeg-8.dll -d jpeg.def -l libjpeg.dll.a
pexports "$BDBIN/libtiff-3.dll" >tiff.def gcc -shared $LDFLAGS -L. -o libtiff-3.dll -def tiff.def \ "$BDLIB/libtiff.a" -ljpeg -lz
pexports "$BDBIN/libtiff-3.dll" | sed '/libport_dummy_function/d' >tiff.def gcc -shared $LDFLAGS -L. -def tiff.def \ "$BDLIB/libtiff.a" -mwindows -ljpeg -lz -o libtiff-3.dll
dlltool -D libjpeg-8.dll -d jpeg.def -l libjpeg.dll.a
gcc -shared $LDFLAGS -L. -o SDL_image.dll -def SDL_image.def \ "$BDLIB/libSDL_image.a" -lSDL -ljpeg -lpng -ltiff
gcc -shared $LDFLAGS -L. -def SDL_image.def \ "$BDLIB/libSDL_image.a" -mwindows -lSDL -ljpeg -lpng -ltiff -o SDL_image.dll
gcc -shared $LDFLAGS -L. -o SDL_image.dll -def SDL_image.def \ "$BDLIB/libSDL_image.a" -lSDL -ljpeg -lpng -ltiff
strip --strip-all SDL_image.dll
dlltool -D SDL_image.dll -d SDL_image.def -l libSDL_image.dll.a
echo "*** SMPEG rev 389 linking to msvcr90.dll has been disabled for now." echo " use the smpeg.dll provided in the Pygame 1.9.1 dependencies." exit 0
dlltool -D SDL_image.dll -d SDL_image.def -l libSDL_image.dll.a
g++ -shared $LDFLAGS -L. -o smpeg.dll -def smpeg.def \ -Wl,--enable-auto-import -Xlinker --out-implib -Xlinker libsmpeg.dll.a \ "$BDLIB/libsmpeg.a" -lSDL
g++ -shared $LDFLAGS -static-libstdc++ -static-libgcc -L. -def smpeg.def \ -Wl,--enable-auto-import,--out-implib,libsmpeg.dll.a \ "$BDLIB/libsmpeg.a" -mwindows -lSDL -o smpeg.dll
g++ -shared $LDFLAGS -L. -o smpeg.dll -def smpeg.def \ -Wl,--enable-auto-import -Xlinker --out-implib -Xlinker libsmpeg.dll.a \ "$BDLIB/libsmpeg.a" -lSDL
strip --strip-all smpeg.dll
g++ -shared $LDFLAGS -L. -o smpeg.dll -def smpeg.def \ -Wl,--enable-auto-import -Xlinker --out-implib -Xlinker libsmpeg.dll.a \ "$BDLIB/libsmpeg.a" -lSDL
gcc -shared $LDFLAGS -o libogg-0.dll -def ogg.def "$BDLIB/libogg.a"
gcc -shared $LDFLAGS -def ogg.def "$BDLIB/libogg.a" -mwindows -o libogg-0.dll
gcc -shared $LDFLAGS -o libogg-0.dll -def ogg.def "$BDLIB/libogg.a"
strip --strip-all libogg-0.dll
dlltool -D libogg-0.dll -d ogg.def -l libogg.dll.a
gcc -shared $LDFLAGS -L. -o libvorbis-0.dll -def vorbis.def \ "$BDLIB/libvorbis.a" -logg
gcc -shared $LDFLAGS -L. -def vorbis.def \ "$BDLIB/libvorbis.a" -mwindows -logg -o libvorbis-0.dll
gcc -shared $LDFLAGS -L. -o libvorbis-0.dll -def vorbis.def \ "$BDLIB/libvorbis.a" -logg
strip --strip-all libvorbis-0.dll
dlltool -D libvorbis-0.dll -d vorbis.def -l libvorbis.dll.a
gcc -shared $LDFLAGS -L. -o libvorbisfile-3.dll -def vorbisfile.def \ "$BDLIB/libvorbisfile.a" -lvorbis -logg
gcc -shared $LDFLAGS -L. -def vorbisfile.def \ "$BDLIB/libvorbisfile.a" -mwindows -lvorbis -logg -o libvorbisfile-3.dll
gcc -shared $LDFLAGS -L. -o libvorbisfile-3.dll -def vorbisfile.def \ "$BDLIB/libvorbisfile.a" -lvorbis -logg
strip --strip-all libvorbisfile-3.dll
dlltool -D libvorbisfile-3.dll -d vorbisfile.def -l libvorbisfile.dll.a
gcc -shared -shared-libgcc $LDFLAGS -L. -L/usr/local/lib -o SDL_mixer.dll -def SDL_mixer.def \ "$BDLIB/libSDL_mixer.a" -lSDL -lsmpeg -lvorbisfile -lFLAC -lWs2_32 -lwinmm
gcc -shared -static-libgcc $LDFLAGS -L. -L"$BDLIB" -def SDL_mixer.def \ "$BDLIB/libSDL_mixer.a" -mwindows -lSDL -lsmpeg -lvorbisfile -lFLAC -lmikmod -lWs2_32 -lwinmm -o SDL_mixer.dll
gcc -shared -shared-libgcc $LDFLAGS -L. -L/usr/local/lib -o SDL_mixer.dll -def SDL_mixer.def \ "$BDLIB/libSDL_mixer.a" -lSDL -lsmpeg -lvorbisfile -lFLAC -lWs2_32 -lwinmm
strip --strip-all SDL_mixer.dll
dlltool -D SDL_mixer.dll -d SDL_mixer.def -l libSDL_mixer.dll.a
g++ -shared $LDFLAGS -L. -L/usr/local/lib -o portmidi.dll -def portmidi.def \ "$BDLIB/libportmidi.a" -lwinmm
g++ -shared -static-libgcc $LDFLAGS -L. -L/usr/local/lib -def portmidi.def \ "$BDLIB/libportmidi.a" -mwindows -lwinmm -o portmidi.dll
g++ -shared $LDFLAGS -L. -L/usr/local/lib -o portmidi.dll -def portmidi.def \ "$BDLIB/libportmidi.a" -lwinmm
strip --strip-all portmidi.dll
dlltool -D portmidi.dll -d portmidi.def -l portmidi.dll.a
gcc -shared -L. -L/usr/local/lib -o avutil-50.dll -def avutil.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed -Xlinker --out-implib -Xlinker libavutil.dll.a \ "$BDLIB/libavutil.a" -lavutil
gcc -shared -L. -L"$BDLIB" -def avutil.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--out-implib,libavutil.dll.a \ "$BDLIB/libavutil.a" -mwindows -o avutil-50.dll
gcc -shared -L. -L/usr/local/lib -o avutil-50.dll -def avutil.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed -Xlinker --out-implib -Xlinker libavutil.dll.a \ "$BDLIB/libavutil.a" -lavutil
strip --strip-all avutil-50.dll
gcc -shared -L. -L/usr/local/lib -o avutil-50.dll -def avutil.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed -Xlinker --out-implib -Xlinker libavutil.dll.a \ "$BDLIB/libavutil.a" -lavutil
gcc -shared -L. -L/usr/local/lib -o avcodec-52.dll -def avcodec.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import \ -Xlinker --out-implib -Xlinker libavcodec.dll.a \ "$BDLIB/libavcodec.a" -lavutil -lz
gcc -shared -L. -L"$BDLIB" -def avcodec.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import,--out-implib,libavcodec.dll.a \ "$BDLIB/libavcodec.a" -mwindows -lavutil -lz -o avcodec-52.dll
gcc -shared -L. -L/usr/local/lib -o avcodec-52.dll -def avcodec.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import \ -Xlinker --out-implib -Xlinker libavcodec.dll.a \ "$BDLIB/libavcodec.a" -lavutil -lz
strip --strip-all avcodec-52.dll
gcc -shared -L. -L/usr/local/lib -o avcodec-52.dll -def avcodec.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import \ -Xlinker --out-implib -Xlinker libavcodec.dll.a \ "$BDLIB/libavcodec.a" -lavutil -lz
gcc -shared -L. -L/usr/local/lib -o avformat-52.dll -def avformat.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import \ -Xlinker --out-implib -Xlinker libavformat.dll.a \ "$BDLIB/libavformat.a" -lavcodec -lavutil -lz -lWs2_32
gcc -shared -L. -L"BDLIB" -def avformat.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import,--out-implib,libavformat.dll.a \ "$BDLIB/libavformat.a" -mwindows -lavcodec -lavutil -lz -lWs2_32 -o avformat-52.dll
gcc -shared -L. -L/usr/local/lib -o avformat-52.dll -def avformat.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import \ -Xlinker --out-implib -Xlinker libavformat.dll.a \ "$BDLIB/libavformat.a" -lavcodec -lavutil -lz -lWs2_32
strip --strip-all avformat-52.dll
gcc -shared -L. -L/usr/local/lib -o avformat-52.dll -def avformat.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import \ -Xlinker --out-implib -Xlinker libavformat.dll.a \ "$BDLIB/libavformat.a" -lavcodec -lavutil -lz -lWs2_32
gcc -shared -L. -L/usr/local/lib -o swscale-0.dll -def swscale.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import \ -Xlinker --out-implib -Xlinker libswscale.dll.a \ "$BDLIB/libswscale.a" -lavutil
gcc -shared -L. -L"$BDLIB" -def swscale.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import,--out-implib,libswscale.dll.a \ "$BDLIB/libswscale.a" -mwindows -lavutil -o swscale-0.dll
gcc -shared -L. -L/usr/local/lib -o swscale-0.dll -def swscale.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import \ -Xlinker --out-implib -Xlinker libswscale.dll.a \ "$BDLIB/libswscale.a" -lavutil
strip --strip-all swscale-0.dll
gcc -shared -L. -L/usr/local/lib -o swscale-0.dll -def swscale.def $LDFLAGS \ -Wl,-Bsymbolic,--as-needed,--enable-auto-import \ -Xlinker --out-implib -Xlinker libswscale.dll.a \ "$BDLIB/libswscale.a" -lavutil
cat > _ftime.c << 'THE_END' /* Stub function for _ftime. * This is an inline function in Visual C 2008 so is missing from msvcr90.dll */ void _ftime32(struct _timeb *timeptr); void _ftime(struct _timeb *timeptr) { _ftime32(timeptr); } THE_END cat > time.c << 'THE_END' /* Stub function for time. * This is an inlin...
cat > msvcr90.def << 'THE_END'
gcc -c -O2 gmtime.c _ftime.c time.c mktime.c localtime.c _fstati64.c
cat > time.c << 'THE_END' /* Stub function for time. * This is an inline function in Visual C 2008 so is missing from msvcr90.dll */ time_t _time32(time_t *timer); time_t time(time_t *timer) { return _time32(timer); } THE_END gcc -c -O2 gmtime.c mktime.c localtime.c _fstati64.c time.c
cat > msvcr90.def << 'THE_END'
ar rc libmsvcr90.dll.a gmtime.o _ftime.o time.o mktime.o localtime.o _fstati64.o
ar rc libmsvcr90.dll.a gmtime.o mktime.o localtime.o _fstati64.o time.o
dlltool -d msvcr90.def -D msvcr90.dll -l libmsvcr90.dll.a
gcc -c -g gmtime.c _ftime.c time.c mktime.c localtime.c _fstati64.c
gcc -c -g gmtime.c mktime.c localtime.c _fstati64.c time.c
dlltool -d msvcr90.def -D msvcr90.dll -l libmsvcr90.dll.a
ar rc libmsvcr90d.dll.a gmtime.o _ftime.o time.o mktime.o localtime.o _fstati64.o
ar rc libmsvcr90d.dll.a gmtime.o mktime.o localtime.o _fstati64.o time.o
dlltool -d msvcr90.def -D msvcr90d.dll -l libmsvcr90d.dll.a
gcc -c -O2 fstat.c
gcc -c -O2 fstat.c _winver.c
cat > moldname-msvcrt.def << 'THE_END'
ar rc libmoldname.dll.a $OBJS fstat.o
ar rc libmoldname.dll.a $OBJS fstat.o _winver.o
--def moldname-msvcrt.def \
gcc -c -g fstat.c
gcc -c -g fstat.c _winver.c
--def moldname-msvcrt.def \
ar rc libmoldnamed.dll.a $OBJS fstat.o
ar rc libmoldnamed.dll.a $OBJS fstat.o _winver.o
--def moldname-msvcrt.def \
self._TEST_FONTS['fixed'] = ft.Font(os.path.join (FONTDIR, 'test_fixed.otf'))
self._TEST_FONTS['fixed'] = ft.Font(self._fixed_path)
def setUp(self): ft.init()
self._TEST_FONTS['sans'] = ft.Font(os.path.join (FONTDIR, 'test_sans.ttf'))
self._TEST_FONTS['sans'] = ft.Font(self._sans_path)
def setUp(self): ft.init()
f = ft.Font(None, ptsize=24) self.assert_(f.height > 0) self.assertRaises(RuntimeError, f.__init__, os.path.join(FONTDIR, 'nonexistant.ttf')) self.assertRaises(RuntimeError, f.get_size, 'a', ptsize=24) f = ft.Font(self._sans_path, ptsize=24) self.assertEqual(f.name, 'Liberation Sans') self.assertFalse(f.fixed_width) ...
def test_freetype_Font_init(self):
self.assertFalse(f.fixed_width)
self.assertFalse(f.fixed_width) self.assertRaises(RuntimeError, lambda : nullfont().fixed_width)
def test_freetype_Font_fixed_width(self):
self.remove_internal(sprite)
def add_internal(self, sprite): if self.__sprite is not None: self.remove_internal(sprite) self.__sprite.remove_internal(self) self.__sprite = sprite
def main(dest_dir=None):
def command_line(): """Process the command line and return the options""" usage = ("usage: %prog [options] [destination]\n" "\n" "Assemble the Python 2.5 prebuilt dependencies directory. The\n" "default destination is .\\prebuilt .\n" "\n" "At startup this program may prompt for missing information.\n" "Be aware of th...
def main(dest_dir=None): # Top level directories. if dest_dir is None: dest_dir = prebuilt_dir if re.match(r'([A-Za-z]:){0,1}[^"<>:|?*]+$', dest_dir) is None: print "Invalid directory path name %s" % dest_dir return 1 dest_dir = os.path.abspath(dest_dir) if os.path.isdir(dest_dir): if not confirm("Directory %s already ...
print "Invalid directory path name %s" % dest_dir
print_("Invalid directory path name %s" % (dest_dir,))
def main(dest_dir=None): # Top level directories. if dest_dir is None: dest_dir = prebuilt_dir if re.match(r'([A-Za-z]:){0,1}[^"<>:|?*]+$', dest_dir) is None: print "Invalid directory path name %s" % dest_dir return 1 dest_dir = os.path.abspath(dest_dir) if os.path.isdir(dest_dir): if not confirm("Directory %s already ...
if os.path.isdir(dest_dir):
if not force and os.path.isdir(dest_dir):
def main(dest_dir=None): # Top level directories. if dest_dir is None: dest_dir = prebuilt_dir if re.match(r'([A-Za-z]:){0,1}[^"<>:|?*]+$', dest_dir) is None: print "Invalid directory path name %s" % dest_dir return 1 dest_dir = os.path.abspath(dest_dir) if os.path.isdir(dest_dir): if not confirm("Directory %s already ...
m = msys.Msys() src_dir = os.path.join(m.msys_root, 'local')
if not src_dir: try: m = msys.Msys() except msys.MsysException: return 0 src_dir = os.path.join(m.msys_root, 'local') else: src_dir = os.path.abspath(src_dir) if not os.path.isdir(src_dir): print_("Source directory %s not found." % (src_dir,)) return 1 print_("=== Assembling ===")
def main(dest_dir=None): # Top level directories. if dest_dir is None: dest_dir = prebuilt_dir if re.match(r'([A-Za-z]:){0,1}[^"<>:|?*]+$', dest_dir) is None: print "Invalid directory path name %s" % dest_dir return 1 dest_dir = os.path.abspath(dest_dir) if os.path.isdir(dest_dir): if not confirm("Directory %s already ...
if len(sys.argv) > 1: dest_dir = sys.argv[1] try: sys.exit(main(dest_dir))
if args: dest_dir = args[0] try: sys.exit(main(dest_dir=dest_dir, src_dir=options.source_directory, msys_dir=options.msys_directory, force=options.force))
make_libs.write('%sLINK.EXE /LIB /NOLOGO /DEF:%s.def /MACHINE:IX86 /OUT:%s.lib\n' % (start, lib, lib))
print "*** %s; execution halted" % e
print_("*** %s; execution halted" % (e,))
make_libs.write('%sLINK.EXE /LIB /NOLOGO /DEF:%s.def /MACHINE:IX86 /OUT:%s.lib\n' % (start, lib, lib))
font.render((screen, 298, 320), "I \u2665 Unicode", pygame.Color(0, 0xCC, 0xDD), None,
utext = pygame.compat.as_unicode(r"I \u2665 Unicode") font.render((screen, 298, 320), utext, pygame.Color(0, 0xCC, 0xDD), None,
def run(): pygame.init() fontdir = os.path.dirname(os.path.abspath (__file__)) font = freetype.Font(os.path.join (fontdir, "data", "sans.ttf")) screen = pygame.display.set_mode((800, 600)) screen.fill (colors["grey_light"]) font.render((screen, 32, 32), "Hello World", colors["red"], colors['grey_dark'], ptsize=64, s...
font.render((screen, 480, 32), "\u2665", colors["grey_light"], colors["red"],
utext = pygame.compat.as_unicode(r"\u2665") font.render((screen, 480, 32), utext, colors["grey_light"], colors["red"],
def run(): pygame.init() fontdir = os.path.dirname(os.path.abspath (__file__)) font = freetype.Font(os.path.join (fontdir, "data", "sans.ttf")) screen = pygame.display.set_mode((800, 600)) screen.fill (colors["grey_light"]) font.render((screen, 32, 32), "Hello World", colors["red"], colors['grey_dark'], ptsize=64, s...
font.render((screen, 380, 380), "...yes, this is a SDL surface", pygame.Color(0, 0, 0), None,
font.render((screen, 380, 380), "...yes, this is an SDL surface", pygame.Color(0, 0, 0), None,
def run(): pygame.init() fontdir = os.path.dirname(os.path.abspath (__file__)) font = freetype.Font(os.path.join (fontdir, "data", "sans.ttf")) screen = pygame.display.set_mode((800, 600)) screen.fill (colors["grey_light"]) font.render((screen, 32, 32), "Hello World", colors["red"], colors['grey_dark'], ptsize=64, s...
with open(os.path.join(__dir__, "bookmarks","a")) as f:
with open(os.path.join(__dir__, "bookmarks"), "a") as f:
def bookmark(self): '''Put the current url in a file named bookmarks''' with open(os.path.join(__dir__, "bookmarks","a")) as f: f.write(self.web_view.get_main_frame().get_uri() + "\n")
def on_active(self, widge, data=None):
def on_active(self, widget, data=None):
def on_active(self, widge, data=None): '''When the user enters an address in the bar, we check to make sure they added the http://, if not we add it for them. Once the url is correct, we just ask webkit to open that site.''' url = self.url_bar.get_text() try: url.index("://") except: url = "http://"+url self.url_bar.s...