diff options
author | makkalot <makkalot@gmail.com> | 2008-06-30 13:28:16 +0300 |
---|---|---|
committer | makkalot <makkalot@gmail.com> | 2008-06-30 13:28:16 +0300 |
commit | ca6a80e2faaf3b12802130a39c333d2d2a172289 (patch) | |
tree | bb05a609a24427f542281a6384bc608f537c39a2 /func | |
parent | 4316c36007cb14f70ffa2cddd5580aed051dac5f (diff) | |
download | func-ca6a80e2faaf3b12802130a39c333d2d2a172289.tar.gz func-ca6a80e2faaf3b12802130a39c333d2d2a172289.tar.xz func-ca6a80e2faaf3b12802130a39c333d2d2a172289.zip |
simple test method to see all the rendering options in web UI (maybe removed later)
Diffstat (limited to 'func')
-rw-r--r-- | func/minion/modules/echo.py | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/func/minion/modules/echo.py b/func/minion/modules/echo.py new file mode 100644 index 0000000..39af619 --- /dev/null +++ b/func/minion/modules/echo.py @@ -0,0 +1,116 @@ +""" +Test module for rendering funcweb +""" + +import func_module + +class EchoTest(func_module.FuncModule): + + version = "0.0.1" + api_version = "0.0.1" + description = "Module that all of its methods returns back the same thing it recieves!" + + def run_string(self, command): + """ + Run String + """ + return str(command) + + def run_int(self,command): + """ + Run Integer + """ + return int(command) + + def run_float(self,command): + """ + Run float + """ + return float(command) + + def run_options(self,command): + """ + Run options + """ + return str(command) + + def run_list(self,command): + """ + Run a list + """ + return command + + def run_hash(self,command): + """ + Run hash + """ + + return command + + def register_method_args(self): + """ + Implementing the argument getter + """ + return { + 'run_string':{ + 'args': + { + 'command':{ + 'type':'string', + 'optional':False + } + }, + 'description':'Returns back a string' + }, + 'run_int':{ + 'args': + { + 'command':{ + 'type':'int', + 'optional':False + } + }, + 'description':'Returns back an integer' + }, + 'run_float':{ + 'args': + { + 'command':{ + 'type':'float', + 'optional':False + }, + }, + 'description':'Returns back a float' + }, + 'run_options':{ + 'args':{ + 'command':{ + 'type':'string', + 'optional':False, + 'options':['first_option','second_option','third_option'] + }, + }, + 'description':'Getting the status of the service_name' + }, + 'run_list':{ + 'args': + { + 'command':{ + 'type':'list', + 'optional':False + } + }, + 'description':'Returns back a list' + }, + 'run_hash':{ + 'args': + { + 'command':{ + 'type':'hash', + 'optional':False + } + }, + 'description':'Returns back a hash' + } + + } |