瀏覽代碼

Finish JSON stringification (closes #29)

tags/v1.0^2
Ben Kurtovic 10 年之前
父節點
當前提交
52c7e9cf5e
共有 1 個檔案被更改,包括 7 行新增3 行删除
  1. +7
    -3
      bitshift/codelet.py

+ 7
- 3
bitshift/codelet.py 查看文件

@@ -77,6 +77,10 @@ class Codelet(object):
:return: The JSON codelet representation.
:rtype: str
"""
lang = LANGS[self.language]
data = {"name": self.name, "code": self.code, "lang": lang}
return json.dumps(data)
return json.dumps({
"name": self.name, "code": self.code, "lang": LANGS[self.language],
"authors": self.authors, "url": self.code_url,
"created": self.date_created.isoformat(),
"modified": self.date_modified.isoformat(),
"symbols": self.symbols, "origin": self.origin
})

Loading…
取消
儲存