Add MenuOptions class for report options.

svn: r8926
This commit is contained in:
Brian Matherly
2007-09-05 03:02:50 +00:00
parent af618d3079
commit febd6e9ed5
8 changed files with 681 additions and 271 deletions

View File

@ -831,6 +831,11 @@ def get_new_filename(ext,folder='~/'):
ix = ix + 1
return os.path.expanduser(_NEW_NAME_PATTERN % (folder,os.path.sep,ix,ext))
def cast_to_bool(val):
if val == str(True):
return True
return False
def get_type_converter(val):
"""
Returns function that converts strings into the type of val.
@ -842,6 +847,8 @@ def get_type_converter(val):
return int
elif val_type == float:
return float
elif val_type == bool:
return cast_to_bool
elif val_type in (list,tuple):
return list