| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 078b8a8 commit 8381f90
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -81,7 +81,8 @@ def __init__(self, root=None, font=None, name=None, exists=False, | |||
| 81 | 81 | if exists: | |
| 82 | 82 | self.delete_font = False | |
| 83 | 83 | # confirm font exists | |
| 84 | - if self.name not in root.tk.call("font", "names"): | ||
| 84 | + if self.name not in root.tk.splitlist( | ||
| 85 | + root.tk.call("font", "names")): | ||
| 85 | 86 | raise tkinter._tkinter.TclError( | |
| 86 | 87 | "named font %s does not already exist" % (self.name,)) | |
| 87 | 88 | # if font config info supplied, apply it | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -407,8 +407,6 @@ def test_list_from_layouttuple(self): | |||
| 407 | 407 | ('name', 'no_minus', 'value')) | |
| 408 | 408 | self.assertRaises(ValueError, ttk._list_from_layouttuple, tk, | |
| 409 | 409 | ('something', '-children')) # no children | |
| 410 | - self.assertRaises(ValueError, ttk._list_from_layouttuple, tk, | ||
| 411 | - ('something', '-children', 'value')) # invalid children | ||
| 412 | 410 | ||
| 413 | 411 | ||
| 414 | 412 | def test_val_or_dict(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -275,6 +275,7 @@ def _list_from_statespec(stuple): | |||
| 275 | 275 | def _list_from_layouttuple(tk, ltuple): | |
| 276 | 276 | """Construct a list from the tuple returned by ttk::layout, this is | |
| 277 | 277 | somewhat the reverse of _format_layoutlist.""" | |
| 278 | + ltuple = tk.splitlist(ltuple) | ||
| 278 | 279 | res = [] | |
| 279 | 280 | ||
| 280 | 281 | indx = 0 | |
@@ -293,8 +294,6 @@ def _list_from_layouttuple(tk, ltuple): | |||
| 293 | 294 | indx += 2 | |
| 294 | 295 | ||
| 295 | 296 | if opt == 'children': | |
| 296 | - if not tk.wantobjects(): | ||
| 297 | - val = tk.splitlist(val) | ||
| 298 | 297 | val = _list_from_layouttuple(tk, val) | |
| 299 | 298 | ||
| 300 | 299 | opts[opt] = val | |
@@ -408,8 +407,8 @@ def map(self, style, query_opt=None, **kw): | |||
| 408 | 407 | return _list_from_statespec(self.tk.splitlist( | |
| 409 | 408 | self.tk.call(self._name, "map", style, '-%s' % query_opt))) | |
| 410 | 409 | ||
| 411 | - return _dict_from_tcltuple( | ||
| 412 | - self.tk.call(self._name, "map", style, *(_format_mapdict(kw)))) | ||
| 410 | + return _dict_from_tcltuple(self.tk.splitlist( | ||
| 411 | + self.tk.call(self._name, "map", style, *(_format_mapdict(kw))))) | ||
| 413 | 412 | ||
| 414 | 413 | ||
| 415 | 414 | def lookup(self, style, option, state=None, default=None): | |
@@ -463,8 +462,8 @@ def layout(self, style, layoutspec=None): | |||
| 463 | 462 | lspec = "null" # could be any other word, but this may make sense | |
| 464 | 463 | # when calling layout(style) later | |
| 465 | 464 | ||
| 466 | - return _list_from_layouttuple(self.tk, self.tk.splitlist( | ||
| 467 | - self.tk.call(self._name, "layout", style, lspec))) | ||
| 465 | + return _list_from_layouttuple(self.tk, | ||
| 466 | + self.tk.call(self._name, "layout", style, lspec)) | ||
| 468 | 467 | ||
| 469 | 468 | ||
| 470 | 469 | def element_create(self, elementname, etype, *args, **kw): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments