bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.15, 1.16

cvs@intevation.de cvs at intevation.de
Sat Dec 18 01:29:06 CET 2004


Author: bernhard

Update of /thubanrepository/thuban/Extensions/svgexport/test
In directory doto:/tmp/cvs-serv14941/Extensions/svgexport/test

Modified Files:
	test_svgmapwriter.py 
Log Message:
	Refactored in svgexport:
	DrawPath replaces DrawPolygon; added newline in front of "M" in paths.

	* Extensions/svgexport/svgmapwriter.py
	Added verbosity level 3 to print out polygon points.
	(class Point): added __repr__
	(class Brush, __str__()): Added space after ,.
	(DrawPolygon): Renamed to DrawPath()
	(DrawPath): Takes list of polygons as input now, adds \n before "M"s.
	(DrawLines): Using DrawPath now.

	* Extensions/svgexport/test/test_svgmapwriter.py:
	Replaced DrawPolygon() calls with DrawPath() and put the first argument
	inside another list. Adapted test data with a newline before "M".


Index: test_svgmapwriter.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- test_svgmapwriter.py	17 Dec 2004 23:06:03 -0000	1.15
+++ test_svgmapwriter.py	18 Dec 2004 00:29:04 -0000	1.16
@@ -99,13 +99,13 @@
         '''Set drawing properties and draw a polygon onto the dc.'''
         data = ('<path style="stroke-linejoin:round; stroke:#ff00ff; '
                 'stroke-width:3; stroke-linecap:round; fill:#00ff00" ' 
-                'meta="Object:test; Label:nothing" d="M 5.6 5.5 '
+                'meta="Object:test; Label:nothing" d="\nM 5.6 5.5 '
                 'L 95.4 5.3 L 95.2 95.1 L 5.0 95.0 L 5.0 5.0 Z"/>')
         dc = self.dc
         dc.SetPen(self.solid_pen)
         dc.SetMeta(self.meta)
         dc.SetBrush(self.solid_brush)
-        dc.DrawPolygon(self.polygon, 1)
+        dc.DrawPath([self.polygon], 1)
         self.assertEquals(xmlsupport.sax_eventlist(data=data), 
                           xmlsupport.sax_eventlist(data=self.file.getvalue()))
     
@@ -113,13 +113,13 @@
         '''Set drawing properties and draw a polygon onto the dc.'''
         data = ('<path style="stroke-linejoin:round; stroke:#ff00ff; '
                 'stroke-width:3; stroke-linecap:round; fill:#00ff00" ' 
-                'meta="Object:test; Label:nothing" d="M 5.6 5.5'
+                'meta="Object:test; Label:nothing" d="\nM 5.6 5.5'
                 '\nL 95.4 5.3\nL 95.2 95.1\nL 5.0 95.0\nL 5.0 5.0"/>')
         dc = self.dc
         dc.SetPen(self.solid_pen)
         dc.SetMeta(self.meta)
         dc.SetBrush(self.solid_brush)
-        dc.DrawPolygon(self.polygon, 0)
+        dc.DrawPath([self.polygon], 0)
         self.assertEquals(xmlsupport.sax_eventlist(data=data), 
                           xmlsupport.sax_eventlist(data=self.file.getvalue()))
 
@@ -127,13 +127,13 @@
         '''Test dc drawing a transparent polygon.'''
         data = ('<path style="stroke-linejoin:round; stroke:#ff00ff; '
                 'stroke-width:3; stroke-linecap:round; fill:none" ' 
-                'meta="Object:test; Label:nothing" d="M 5.6 5.5'
+                'meta="Object:test; Label:nothing" d="\nM 5.6 5.5'
                 ' L 95.4 5.3\nL 95.2 95.1\nL 5.0 95.0\nL 5.0 5.0"/>')
         dc = self.dc
         dc.SetPen(self.solid_pen)
         dc.SetMeta(self.meta)
         dc.SetBrush(self.trans_brush)
-        dc.DrawPolygon(self.polygon, 0)
+        dc.DrawPath([self.polygon], 0)
         self.assertEquals(xmlsupport.sax_eventlist(data=data), 
                           xmlsupport.sax_eventlist(data=self.file.getvalue()))
 
@@ -349,7 +349,7 @@
                 '        <path style="stroke-linejoin:round; stroke:#000000; '
                 'stroke-width:0.01; stroke-linecap:round; fill:none" '
                 'id="P-Layer_0"'
-                '  d="M 0.0 0.0\nL 10.0 -10.0\nL 0.0 -10.0\nL 0.0 0.0 Z"/>\n'
+                '  d="\nM 0.0 0.0\nL 10.0 -10.0\nL 0.0 -10.0\nL 0.0 0.0 Z"/>\n'
                 '    </g>\n</g>\n')
         table = MemoryTable([("type", FIELDTYPE_STRING),
                              ("value", FIELDTYPE_DOUBLE),





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)