def conv_align(val): # This should work, but Tk doesn't actually do the right # thing so for now everything gets mapped to BASELINE # alignment. return BASELINE conv = grailutil.conv_enumeration( grailutil.conv_normstring(val), {'top': TOP, 'middle': CENTER, # not quite right 'bottom': BASELINE, 'absbottom': BOTTOM, # compatibility hack... 'absmiddle': CENTER, # compatibility hack... }) if conv: return conv else: return CENTER
def conv_rules(val): return grailutil.conv_enumeration( grailutil.conv_normstring(val), ['none', 'groups', 'rows', 'cols', 'all'])
def conv_frame(val): return grailutil.conv_enumeration( grailutil.conv_normstring(val), ['void', 'above', 'below', 'hsides', 'lhs', 'rhs', 'vsides', 'box', 'border'])
def conv_halign(val): return grailutil.conv_enumeration(grailutil.conv_normstring(val), ['left', 'center', 'right', 'justify', 'char'])
def conv_valign(val): return grailutil.conv_enumeration(grailutil.conv_normstring(val), ['top', 'middle', 'bottom', 'baseline'])
def conv_align(val): return grailutil.conv_enumeration( grailutil.conv_normstring(val), ['top', 'bottom', 'left', 'right']) or 'top'
def conv_frame(val): return grailutil.conv_enumeration(grailutil.conv_normstring(val), [ 'void', 'above', 'below', 'hsides', 'lhs', 'rhs', 'vsides', 'box', 'border' ])
def conv_halign(val): return grailutil.conv_enumeration( grailutil.conv_normstring(val), ['left', 'center', 'right', 'justify', 'char'])