mailr16254 - /branches/uf_redesign/gui/uf_objects.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on May 12, 2012 - 11:13:
Author: bugman
Date: Sat May 12 11:13:40 2012
New Revision: 16254

URL: http://svn.gna.org/viewcvs/relax?rev=16254&view=rev
Log:
The auto-generated GUI user functions can now handle the 'val_list' argument 
type.

This is needed for the value.set user function whereby the 'value' argument 
can be almost anything,
either as a single float, int, str, None, etc or as a list.


Modified:
    branches/uf_redesign/gui/uf_objects.py

Modified: branches/uf_redesign/gui/uf_objects.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/uf_objects.py?rev=16254&r1=16253&r2=16254&view=diff
==============================================================================
--- branches/uf_redesign/gui/uf_objects.py (original)
+++ branches/uf_redesign/gui/uf_objects.py Sat May 12 11:13:40 2012
@@ -230,9 +230,9 @@
                 self.element_bool(key=arg['name'], 
element_type=arg['wiz_element_type'], sizer=sizer, desc=desc, 
tooltip=arg['desc'], default=arg['default'])
 
             # Sequence types.
-            elif arg['py_type'] in ['float_list', 'int_list', 'num_list', 
'str_list', 'float_tuple', 'int_tuple', 'num_tuple', 'str_tuple', 
'float_array', 'int_array', 'float_or_float_list', 'int_or_int_list', 
'num_or_num_list', 'str_or_str_list', 'float_or_float_tuple', 
'int_or_int_tuple', 'num_or_num_tuple', 'str_or_str_tuple']:
+            elif arg['py_type'] in ['float_list', 'int_list', 'num_list', 
'str_list', 'float_tuple', 'int_tuple', 'num_tuple', 'str_tuple', 
'float_array', 'int_array', 'float_or_float_list', 'int_or_int_list', 
'num_or_num_list', 'str_or_str_list', 'float_or_float_tuple', 
'int_or_int_tuple', 'num_or_num_tuple', 'str_or_str_tuple', 'val_or_list']:
                 # The sequence type.
-                if arg['py_type'] in ['float_list', 'int_list', 'num_list', 
'str_list', 'float_array', 'int_array', 'float_or_float_list', 
'int_or_int_list', 'num_or_num_list', 'str_or_str_list']:
+                if arg['py_type'] in ['float_list', 'int_list', 'num_list', 
'str_list', 'float_array', 'int_array', 'float_or_float_list', 
'int_or_int_list', 'num_or_num_list', 'str_or_str_list', 'val_or_list']:
                     seq_type = 'list'
                 else:
                     seq_type = 'tuple'
@@ -242,12 +242,14 @@
                     value_type = 'float'
                 elif arg['py_type'] in ['int_list', 'int_tuple', 
'int_array', 'int_or_int_list', 'int_or_int_tuple']:
                     value_type = 'int'
+                elif arg['py_type'] in ['str_list', 'str_tuple', 
'str_array', 'str_or_str_list', 'str_or_str_tuple']:
+                    value_type = 'str'
                 else:
-                    value_type = 'str'
+                    value_type = None
 
                 # Single values.
                 single_value = False
-                if arg['py_type'] in ['float_or_float_list', 
'int_or_int_list', 'num_or_num_list', 'str_or_str_list', 
'float_or_float_tuple', 'int_or_int_tuple', 'num_or_num_tuple', 
'str_or_str_tuple']:
+                if arg['py_type'] in ['float_or_float_list', 
'int_or_int_list', 'num_or_num_list', 'str_or_str_list', 
'float_or_float_tuple', 'int_or_int_tuple', 'num_or_num_tuple', 
'str_or_str_tuple', 'val_or_list']:
                     single_value = True
 
                 # Dimensions.




Related Messages


Powered by MHonArc, Updated Sat May 12 11:20:02 2012