summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Chaplin <>2011-04-03 10:03:18 +0800
committerSteve Chaplin <>2011-04-03 10:03:18 +0800
commit4a41ab1ced69ec429a34fcb7b88999da06abf8b1 (patch)
treef73184431224fd668266de6c7a05f4b55f2d4041
parent247c9f62c71710b518faf9c3e5539c6caddcbbda (diff)
downloadpycairo-4a41ab1ced69ec429a34fcb7b88999da06abf8b1.tar.gz
Remove examples/cairo_snippets/data/romedalen.png and examples which use this
file. Update wscript to exclude unwanted files from distribution archive.
-rw-r--r--examples/cairo_snippets/data/.gitignore1
-rw-r--r--examples/cairo_snippets/data/romedalen.pngbin80944 -> 0 bytes
-rwxr-xr-xexamples/cairo_snippets/snippets/clip_image.py13
-rwxr-xr-xexamples/cairo_snippets/snippets/image.py14
-rwxr-xr-xexamples/cairo_snippets/snippets/imagepattern.py23
-rw-r--r--wscript34
6 files changed, 16 insertions, 69 deletions
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
--- a/examples/cairo_snippets/data/romedalen.png
+++ /dev/null
Binary files 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)