This commit is contained in:
commit
8710c988c4
32
tasks/task.js
Normal file
32
tasks/task.js
Normal 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
tasks/task.py
Normal file
22
tasks/task.py
Normal 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()
|
Loading…
Reference in New Issue
Block a user