def _format_optdict(optdict, script=False, ignore=None):
 opts = []
 for (opt, value) in optdict.iteritems():
  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 . iteritems ( ) : 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 )
formats optdict to a tuple to pass it to tk .