diff options
author | makkalot <makkalot@gmail.com> | 2008-06-20 00:02:18 +0300 |
---|---|---|
committer | makkalot <makkalot@gmail.com> | 2008-06-20 00:02:18 +0300 |
commit | 5556eb2c218931dcb6f8c5a004eb9b9902cc10e8 (patch) | |
tree | 91fdb689df4dd372bde3379c2ccea1cbc79def6f /func/minion | |
parent | bbc22ea440ae543e18dba21d96313bc658efaa29 (diff) | |
download | func-5556eb2c218931dcb6f8c5a004eb9b9902cc10e8.tar.gz func-5556eb2c218931dcb6f8c5a004eb9b9902cc10e8.tar.xz func-5556eb2c218931dcb6f8c5a004eb9b9902cc10e8.zip |
if there is a options keyword in args the others should be there there is no sense
Diffstat (limited to 'func/minion')
-rw-r--r-- | func/minion/func_arg.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/func/minion/func_arg.py b/func/minion/func_arg.py index bde5388..6ff7a35 100644 --- a/func/minion/func_arg.py +++ b/func/minion/func_arg.py @@ -66,6 +66,15 @@ class ArgCompatibility(object): #did module writer add a key 'type' if not argument_dict.has_key('type') or not self.__valid_args.has_key(argument_dict['type']): raise IncompatibleTypesException("%s is not in valid options,possible ones are :%s"%(argument_dict['type'],str(self.__valid_args))) + + #we need some specialization about if user has defined options + #there is no need for using validator,min_lenght,max_length + if argument_dict.has_key('options'): + for arg_option in argument_dict.keys(): + if arg_option!='options' and arg_option in self.__valid_args['string']: + raise IncompatibleTypesException('The options keyword should be used alone in a string cant be used with min_length,max_length,validator together') + + #will add here a new for integers # we will use it everytime so not make lookups the_type = argument_dict['type'] |