]> git.openstreetmap.org Git - osqa.git/commitdiff
use 4 spaces instead of tabulations
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 5 Aug 2011 14:40:00 +0000 (14:40 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 5 Aug 2011 14:40:00 +0000 (14:40 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1157 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/exporter/exporter.py

index c6734298eedc15c932677dbc433f6f6dabbc3abe..e266858b131431753c4db1d489dacdb2cad44dc0 100644 (file)
@@ -16,28 +16,27 @@ import settings as selfsettings
 import string
 
 try:
-       from xml.etree.ElementTree import fixtag
+    from xml.etree.ElementTree import fixtag
 except ImportError:
-       def fixtag(tag, namespaces):
-               # given a decorated tag (of the form {uri}tag), return prefixed
-               # tag and namespace declaration, if any
-               if isinstance(tag, QName):
-                       tag = tag.text
-               namespace_uri, tag = string.split(tag[1:], "}", 1)
-               prefix = namespaces.get(namespace_uri)
-               if prefix is None:
-                       prefix = _namespace_map.get(namespace_uri)
-                       if prefix is None:
-                               prefix = "ns%d" % len(namespaces)
-                       namespaces[namespace_uri] = prefix
-                       if prefix == "xml":
-                               xmlns = None
-                       else:
-                               xmlns = ("xmlns:%s" % prefix, namespace_uri)
-               else:
-                       xmlns = None
-               return "%s:%s" % (prefix, tag), xmlns
-
+    def fixtag(tag, namespaces):
+        # given a decorated tag (of the form {uri}tag), return prefixed
+        # tag and namespace declaration, if any
+        if isinstance(tag, QName):
+            tag = tag.text
+        namespace_uri, tag = string.split(tag[1:], "}", 1)
+        prefix = namespaces.get(namespace_uri)
+        if prefix is None:
+            prefix = _namespace_map.get(namespace_uri)
+            if prefix is None:
+                prefix = "ns%d" % len(namespaces)
+            namespaces[namespace_uri] = prefix
+            if prefix == "xml":
+                xmlns = None
+            else:
+                xmlns = ("xmlns:%s" % prefix, namespace_uri)
+        else:
+            xmlns = None
+        return "%s:%s" % (prefix, tag), xmlns
 
 CACHE_KEY = "%s_exporter_state" % APP_URL
 EXPORT_STEPS = []