[cairo-commit] pycairo/test cairo_image_surface_create_for_array.py, 1.1, 1.2 test.test, 1.3, 1.4

Steve Chaplin commit at pdx.freedesktop.org
Sun May 1 19:25:53 PDT 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo/test
In directory gabe:/tmp/cvs-serv5655/test

Modified Files:
	cairo_image_surface_create_for_array.py test.test 
Log Message:
SC

Index: cairo_image_surface_create_for_array.py
===================================================================
RCS file: /cvs/cairo/pycairo/test/cairo_image_surface_create_for_array.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cairo_image_surface_create_for_array.py	16 Apr 2005 05:09:51 -0000	1.1
+++ cairo_image_surface_create_for_array.py	2 May 2005 02:25:51 -0000	1.2
@@ -18,9 +18,4 @@
 surface = cairo.ImageSurface.create_for_array(array)
 ctx.set_target_surface(surface)
 
-try:
-    fileObject = file('cairo_image_surface_create_for_array.png', 'wb')
-except IOError, exc:
-    raise SystemExit("%s: %s" % (exc.filename, exc.strerror))
-
-surface.write_png(fileObject)
+surface.write_to_png('cairo_image_surface_create_for_array.png')

Index: test.test
===================================================================
RCS file: /cvs/cairo/pycairo/test/test.test,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- test.test	29 Apr 2005 09:11:16 -0000	1.3
+++ test.test	2 May 2005 02:25:51 -0000	1.4
@@ -1,11 +1,12 @@
 # doctest text file
 
->>> import os, sys
+>>> import os, os.path, sys
 >>> cwd = os.getcwd()
 
 # run non-gui example scripts, check they run and produce no output (error messages)
 # and exit successfully
->>> os.chdir('%s/../examples' % cwd)
+>>> _dir = os.path.join(cwd, '..', 'examples')
+>>> os.chdir (_dir)
 >>> files = [f for f in os.listdir('.') if f.endswith('.py')]
 >>> for f in files:
 ...     ret = os.system ('python %s' % f) # return value is system dependent
@@ -14,7 +15,8 @@
 
 # run png snippets
 >>> cmd = 'python snippets_png.py -s'
->>> os.chdir('%s/../examples/cairo_snippets' % cwd)
+>>> _dir = os.path.join(cwd, '..', 'examples', 'cairo_snippets')
+>>> os.chdir (_dir)
 >>> ret = os.system (cmd)
 >>> if ret != 0 and sys.platform.startswith('linux'): 
 ...     print 'Error:', cmd, 'returned', ret




More information about the cairo-commit mailing list