From: t.moriyama Date: Sat, 20 Jul 2013 18:33:06 +0000 (+0900) Subject: modify LinkObject, LinkPair for JsonExporter X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3202d7ca64ba4a930e4c85c7e182e2bd332f9152;p=ti2%2Fti2.git modify LinkObject, LinkPair for JsonExporter --- diff --git a/linkpair/linkobject.py b/linkpair/linkobject.py index fa2a590..951b0ca 100755 --- a/linkpair/linkobject.py +++ b/linkpair/linkobject.py @@ -48,8 +48,8 @@ class LinkObject(object): def __repr__(self): return "{\"label\":\"" + self.label + \ - "\", \"type\":\"" + repr(self.type) + \ - "\", \"meta\":" + self._blank_dict(self.metadata) + "}" + "\",\"type\":\"" + repr(self.type) + \ + "\",\"meta\":" + self._blank_dict(self.metadata) + "}" def _blank_dict(self, dict_object): if len(dict_object) > 0: diff --git a/linkpair/linkpair.py b/linkpair/linkpair.py index bbd1494..ab11a26 100755 --- a/linkpair/linkpair.py +++ b/linkpair/linkpair.py @@ -67,8 +67,8 @@ class LinkPair(object): return "\"\"" def to_json(self): - return "{ \"device1\":" + repr(self.device1) + ", " + \ - " \"device2\":" + repr(self.device2) + ", " + \ - " \"port1\":" + repr(self.port1) + ", " + \ - " \"port2\":" + repr(self.port2) + ", " + \ - " \"format\":" + self._blank_format(self.format_name) + "}" + return "{\"device1\":" + repr(self.device1) + "," + \ + "\"device2\":" + repr(self.device2) + "," + \ + "\"port1\":" + repr(self.port1) + "," + \ + "\"port2\":" + repr(self.port2) + "," + \ + "\"format\":" + self._blank_format(self.format_name) + "}"