From 4a41ab1ced69ec429a34fcb7b88999da06abf8b1 Mon Sep 17 00:00:00 2001 From: Steve Chaplin <> Date: Sun, 3 Apr 2011 10:03:18 +0800 Subject: Remove examples/cairo_snippets/data/romedalen.png and examples which use this file. Update wscript to exclude unwanted files from distribution archive. --- examples/cairo_snippets/data/.gitignore | 1 - examples/cairo_snippets/data/romedalen.png | Bin 80944 -> 0 bytes examples/cairo_snippets/snippets/clip_image.py | 13 --------- examples/cairo_snippets/snippets/image.py | 14 ---------- examples/cairo_snippets/snippets/imagepattern.py | 23 --------------- wscript | 34 +++++++++++------------ 6 files changed, 16 insertions(+), 69 deletions(-) delete mode 100644 examples/cairo_snippets/data/.gitignore delete mode 100644 examples/cairo_snippets/data/romedalen.png delete mode 100755 examples/cairo_snippets/snippets/clip_image.py delete mode 100755 examples/cairo_snippets/snippets/image.py delete mode 100755 examples/cairo_snippets/snippets/imagepattern.py diff --git a/examples/cairo_snippets/data/.gitignore b/examples/cairo_snippets/data/.gitignore deleted file mode 100644 index 9622ba3..0000000 --- a/examples/cairo_snippets/data/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!romedalen.png diff --git a/examples/cairo_snippets/data/romedalen.png b/examples/cairo_snippets/data/romedalen.png deleted file mode 100644 index 0c41eb0..0000000 Binary files a/examples/cairo_snippets/data/romedalen.png and /dev/null differ diff --git a/examples/cairo_snippets/snippets/clip_image.py b/examples/cairo_snippets/snippets/clip_image.py deleted file mode 100755 index 39a84ab..0000000 --- a/examples/cairo_snippets/snippets/clip_image.py +++ /dev/null @@ -1,13 +0,0 @@ -snippet_normalize (cr, width, height) - -cr.arc (0.5, 0.5, 0.3, 0, 2*M_PI) -cr.clip () - -image = cairo.ImageSurface.create_from_png ("data/romedalen.png") -w = image.get_width() -h = image.get_height() - -cr.scale (1.0/w, 1.0/h) - -cr.set_source_surface (image, 0, 0) -cr.paint () diff --git a/examples/cairo_snippets/snippets/image.py b/examples/cairo_snippets/snippets/image.py deleted file mode 100755 index ccadc4f..0000000 --- a/examples/cairo_snippets/snippets/image.py +++ /dev/null @@ -1,14 +0,0 @@ -snippet_normalize (cr, width, height) - -image = cairo.ImageSurface.create_from_png ("data/romedalen.png") -w = image.get_width() -h = image.get_height() - -cr.translate (0.5, 0.5) -cr.rotate (45* M_PI/180) -cr.scale (1.0/w, 1.0/h) -cr.translate (-0.5*w, -0.5*h) - -cr.set_source_surface (image, 0, 0) -cr.paint () - diff --git a/examples/cairo_snippets/snippets/imagepattern.py b/examples/cairo_snippets/snippets/imagepattern.py deleted file mode 100755 index 5d07c07..0000000 --- a/examples/cairo_snippets/snippets/imagepattern.py +++ /dev/null @@ -1,23 +0,0 @@ -import math - -snippet_normalize (cr, width, height) - -image = cairo.ImageSurface.create_from_png ("data/romedalen.png") -w = image.get_width() -h = image.get_height() - -pattern = cairo.SurfacePattern (image) -pattern.set_extend (cairo.EXTEND_REPEAT) - -cr.translate (0.5, 0.5) -cr.rotate (M_PI / 4) -cr.scale (1 / math.sqrt (2), 1 / math.sqrt (2)) -cr.translate (- 0.5, - 0.5) - -matrix = cairo.Matrix(xx=w * 5, yy=h * 5) -pattern.set_matrix (matrix) - -cr.set_source (pattern) - -cr.rectangle (0, 0, 1.0, 1.0) -cr.fill () diff --git a/wscript b/wscript index 5403a7c..e167b59 100644 --- a/wscript +++ b/wscript @@ -65,25 +65,23 @@ def build(ctx): ) -def dist_hook(): - # remove unwanted files from the archive - - # individual files - for f in [ +def dist(ctx): + # exclude these files from the distribution archive + exclude = ( 'RELEASING', 'examples/cairo_snippets/c_to_python.py', 'doc/html_docs_create.sh', 'doc/html_docs_upload.sh', - ]: - os.remove(f) - - # rm examples/*.{pdf,png,ps,svg} - D='examples' - for f in os.listdir(D): - if f.endswith(('.pdf', '.png', '.ps', '.svg')): - os.remove(os.path.join(D, f)) - - D='examples/cairo_snippets/snippets' - for f in os.listdir(D): - if f.endswith(('.pdf', '.png', '.ps', '.svg')): - os.remove(os.path.join(D, f)) + + '.git/', + '**/.gitignore', + '**/.lock-w*', + '.waf3*', + + '**/*.pdf', + '**/*.png', + '**/*.pyc', + '**/*.ps', + '**/*.svg', + ) + ctx.excl = ' '.join(exclude) -- cgit v1.2.3