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