This commit is contained in:
anwinged 2012-03-08 07:40:14 +00:00
parent 7a22017dae
commit 22c2e66820
2 changed files with 54 additions and 0 deletions

32
trunk/tasks/task.js Normal file
View File

@ -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
}
}
}
]
}
]
}

22
trunk/tasks/task.py Normal file
View File

@ -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()