(optdict, script=False, ignore=None)
return _flatten(opts)
Formats optdict to a tuple to pass it to tk.call.

    E.g. (script=False):
      {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns:
      ('-foreground', 'blue', '-padding', '1 2 3 4')
Formats optdict to a tuple to pass it to tk.call.
Formats optdict to a tuple to pass it to tk . call .
def _format_optdict(optdict, script=False, ignore=None):
    """Formats optdict to a tuple to pass it to tk.call.

    E.g. (script=False):
      {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns:
      ('-foreground', 'blue', '-padding', '1 2 3 4')"""

    opts = []
    for opt, value in optdict.items():
        if not ignore or opt not in ignore:
            opts.append("-%s" % opt)
            if value is not None:
                opts.append(_format_optvalue(value, script))

    return _flatten(opts)
def _format_optdict ( optdict , script = False , ignore = None ) : opts = [ ] for opt , value in optdict . items ( ) : if not ignore or opt not in ignore : opts . append ( "-%s" % opt ) if value is not None : opts . append ( _format_optvalue ( value , script ) ) return _flatten ( opts )