Formats mapdict to pass it to tk.call. E.g. (script=False): {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]} returns: ('-expand', '{active selected} grey focus {1, 2, 3, 4}')
(mapdict, script=False)
| 75 | return opt_val |
| 76 | |
| 77 | def _format_mapdict(mapdict, script=False): |
| 78 | """Formats mapdict to pass it to tk.call. |
| 79 | |
| 80 | E.g. (script=False): |
| 81 | {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]} |
| 82 | |
| 83 | returns: |
| 84 | |
| 85 | ('-expand', '{active selected} grey focus {1, 2, 3, 4}')""" |
| 86 | |
| 87 | opts = [] |
| 88 | for opt, value in mapdict.items(): |
| 89 | opts.extend(("-%s" % opt, |
| 90 | _format_optvalue(_mapdict_values(value), script))) |
| 91 | |
| 92 | return _flatten(opts) |
| 93 | |
| 94 | def _format_elemcreate(etype, script=False, *args, **kw): |
| 95 | """Formats args and kw according to the given element factory etype.""" |
no test coverage detected
searching dependent graphs…