From 2fec355f291aeac7e94a5dc228a83d528d32600a Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 29 Aug 2013 12:26:06 +0000 Subject: [PATCH 1/1] Test of create_wrmap nearly passes now. git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@1532 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- tests/test_wrmwmarkup.py | 11 +++++++---- wrpylib/wrmwmarkup.py | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/test_wrmwmarkup.py b/tests/test_wrmwmarkup.py index 2ac1d94..c0990c9 100644 --- a/tests/test_wrmwmarkup.py +++ b/tests/test_wrmwmarkup.py @@ -169,14 +169,17 @@ def test_create_wrmap(): wikitext = wrpylib.wrmwmarkup.create_wrmap(geojson) assert wikitext == textwrap.dedent(u'''\ - + + 47.240689 11.190454 47.245789 11.238971 47.245711 11.238283 + - 47.238587 11.203360 - 47.244951 11.230868 - 47.245470 11.237853 + 47.238587 N 11.203360 E + 47.244951 N 11.230868 E + 47.245470 N 11.237853 E + ''') diff --git a/wrpylib/wrmwmarkup.py b/wrpylib/wrmwmarkup.py index d131402..b25ef63 100644 --- a/wrpylib/wrmwmarkup.py +++ b/wrpylib/wrmwmarkup.py @@ -535,9 +535,10 @@ def create_wrmap(geojson): feature_xml.text = '\n' + create_wrmap_coordinates(geo['coordinates']) + '\n' last_json_feature = feature_xml feature_xml.attrib = json_feature['properties'] + del feature_xml.attrib['type'] print last_json_feature.tag if last_json_feature is not None: last_json_feature.tail = '\n\n' - return xml.etree.ElementTree.tostring(wrmap_xml) + return xml.etree.ElementTree.tostring(wrmap_xml, encoding='utf-8') -- 2.30.2