Base class structure for application
This commit is contained in:
@ -1,32 +1,56 @@
|
||||
{
|
||||
"title": "Example task",
|
||||
"author": "Anton Vakhrushev",
|
||||
|
||||
"meta": {
|
||||
"silent": true,
|
||||
}
|
||||
|
||||
"models": [
|
||||
{
|
||||
"title": "Example model",
|
||||
"silent": false,
|
||||
|
||||
"models": {
|
||||
|
||||
"simpleexample": {
|
||||
|
||||
"title": "Simple example model",
|
||||
|
||||
"data": {
|
||||
|
||||
"x": {
|
||||
"type": "int",
|
||||
"default": 10
|
||||
},
|
||||
|
||||
"u": {
|
||||
"type": "double",
|
||||
"default": 3.14
|
||||
}
|
||||
},
|
||||
|
||||
"methods": [
|
||||
{
|
||||
"title": "default",
|
||||
"methods": {
|
||||
|
||||
"default": {
|
||||
"title": "Default method",
|
||||
"data": {
|
||||
"u": {
|
||||
"p": {
|
||||
"type": "int",
|
||||
"default": 20
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"result": {
|
||||
|
||||
"data": {
|
||||
"sum": "int"
|
||||
},
|
||||
|
||||
"table": {
|
||||
"head": [
|
||||
{ "x" : "int" },
|
||||
{ "u" : "double" }
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,18 +5,18 @@ import json
|
||||
|
||||
def main():
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print 'Error!'
|
||||
return
|
||||
## 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, indent = 2)
|
||||
|
||||
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)
|
||||
## elif sys.argv[1] == '-r':
|
||||
## data = raw_input()
|
||||
## data = json.loads(data)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Reference in New Issue
Block a user