diff --git a/trunk/tasks/task.js b/trunk/tasks/task.js new file mode 100644 index 0000000..ca678f5 --- /dev/null +++ b/trunk/tasks/task.js @@ -0,0 +1,32 @@ +{ + "title": "Example task", + + "meta": { + "silent": true, + } + + "models": [ + { + "title": "Example model", + + "data": { + "x": { + "type": "int", + "default": 10 + } + }, + + "methods": [ + { + "title": "default", + "data": { + "u": { + "type": "int", + "default": 20 + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/trunk/tasks/task.py b/trunk/tasks/task.py new file mode 100644 index 0000000..653b2c7 --- /dev/null +++ b/trunk/tasks/task.py @@ -0,0 +1,22 @@ +#! coding: utf-8 + +import sys +import json + +def main(): + + if len(sys.argv) != 2: + print 'Error!' + return + + if sys.argv[1] == '-i': + with open('task.js') as f: + d = json.load(f) + print json.dumps(d) + + elif sys.argv[1] == '-r': + data = raw_input() + data = json.loads(data) + +if __name__ == '__main__': + main() \ No newline at end of file