diff options
author | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-02-27 20:01:17 (GMT) |
---|---|---|
committer | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-02-27 20:01:17 (GMT) |
commit | 770bfc843d9b6a22058546a79b8e00a936856b57 (patch) | |
tree | effcac20bd0dc9381e9dabdbc3c8bf977094078e /utils.py | |
parent | 15ef1be5005b4a46032ee46a58ecabac41debb0b (diff) |
Sharing Changes ( Sharing don't work :( )
Changes:
* File sharing.py created
* Receive and Send classes created (in sharing.py)
* Sharing chart_data, colors, labels, chart types, etc.
But don't works. Manu or Gonzalo, Can you help me?
Signed-off-by: Agustin Zubiaga <aguz@sugarlabs.org>
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -20,6 +20,9 @@ import os import gconf +import json + +from StringIO import StringIO def rgb_to_html(color): @@ -64,3 +67,17 @@ def get_chart_file(activity_dir): def get_decimals(number): """Returns the decimals count of a number""" return str(len(number.split('.')[1])) + + +def json_load(data): + _io_str = StringIO(data) + data = json.load(_io_str) + + return data + + +def json_dump(data): + _io_str = StringIO() + json.dump(data, _io_str) + + return _io_str.getvalue() |