Commits

ben...@localhost.metavers.net  committed 99269f2

we don't want to serialize to xml anymore.

  • Participants
  • Parent commits 7fd55a5

Comments (0)

Files changed (1)

File friendpaste/paste/views.py

     resp.headers['content-type'] = 'application/json'
     return resp
 
-def serialize_xml(d):
-    # simple serializer
-    if not isinstance(d, (dict,list,tuple)):
-        raise TypeError("Expected a dict here")
-    yield "\r\n"
-    if isinstance(d, dict): 
-        for k,v in d.items():
-            if isinstance(v, (dict,list,tuple)):
-                v = "".join(serialize_xml(v))
-            yield "<%(key)s>%(value)s</%(key)s>\r\n" % {
-                'key':k,
-                'value':v
-                }
-    elif isinstance(d, (tuple, list)):
-        for v in d:
-            if isinstance(v, (dict,list,tuple)):
-                v = serialize_xml(v)
-            yield "<value>%s</value>\r\n" % v 
-
-def send_xml(Body): 
-    resp = Response("<paste>\r\n%s</paste>\r\n" % "".join(serialize_xml(Body)))
-    resp.headers['content-type'] = 'application/xml'
-    return resp
-
-
 def _get_snippet_revisions(id):
     db = local.application.db
     # we get only last 10 revisions