1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-12 19:38:57 +00:00

Code cleanup

This commit is contained in:
Julien Duponchelle 2015-02-05 13:55:53 +01:00
parent b92e065add
commit 869405738e
2 changed files with 8 additions and 10 deletions

View File

@ -85,7 +85,7 @@ class Documentation(object):
self._write_json_schema(f, schema['definitions'][definition])
f.write("Body\n+++++++++\n")
def _write_json_schema_object(self, f, obj, schema):
def _write_json_schema_object(self, f, obj):
"""
obj is current object in JSON schema
schema is the whole schema including definitions
@ -126,7 +126,7 @@ class Documentation(object):
<th>Type</th> \
<th>Description</th> \
</tr>\n")
self._write_json_schema_object(f, schema, schema)
self._write_json_schema_object(f, schema)
f.write(" </table>\n\n")

View File

@ -44,15 +44,13 @@ class Response(aiohttp.web.Response):
log.debug(data)
return super().write(data)
"""
Set the response content type to application/json and serialize
the content.
:param anwser The response as a Python object
"""
def json(self, answer):
"""Pass a Python object and return a JSON as answer"""
"""
Set the response content type to application/json and serialize
the content.
:param anwser The response as a Python object
"""
self.content_type = "application/json"
if hasattr(answer, '__json__'):