Merge branch 'master' of makar:/var/www/git/pgfw into HEAD
This commit is contained in:
commit
580d31ead2
|
@ -6,6 +6,7 @@ from distutils.command.install import install
|
|||
from pprint import pprint
|
||||
from fileinput import FileInput
|
||||
from re import sub, match
|
||||
from fnmatch import fnmatch
|
||||
|
||||
from Configuration import *
|
||||
|
||||
|
@ -48,8 +49,9 @@ class Setup:
|
|||
def remove_excluded(self, paths, root, exclude):
|
||||
removal = []
|
||||
for path in paths:
|
||||
if normpath(join(root, path)) in exclude:
|
||||
removal.append(path)
|
||||
for pattern in exclude:
|
||||
if fnmatch(normpath(join(root, path)), pattern):
|
||||
removal.append(path)
|
||||
for path in removal:
|
||||
paths.remove(path)
|
||||
return paths
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from random import randint
|
||||
from math import sin, cos, atan2, radians, sqrt
|
||||
|
||||
from pygame import Surface
|
||||
from pygame import Surface, PixelArray
|
||||
from pygame.mixer import get_num_channels, Channel
|
||||
from pygame.locals import *
|
||||
|
||||
def get_step(start, end, speed):
|
||||
|
@ -128,3 +129,16 @@ def render_box(font, text, antialias, color, background=None, border=None,
|
|||
bordered_surface.blit(surface, rect)
|
||||
surface = bordered_surface
|
||||
return surface
|
||||
|
||||
def get_color_swapped_surface(surface, current, replacement):
|
||||
swapped = surface.copy()
|
||||
pixels = PixelArray(swapped)
|
||||
pixels.replace(current, replacement)
|
||||
del pixels
|
||||
return swapped
|
||||
|
||||
def get_busy_channel_count():
|
||||
count = 0
|
||||
for index in xrange(get_num_channels()):
|
||||
count += Channel(index).get_busy()
|
||||
return count
|
||||
|
|
Loading…
Reference in New Issue