Commit 1254075
committed
Tell IPython the correct GUI event loop to use for all backends.
IPython currently uses a hard-coded table
(IPython.core.pylabtools.backend2gui) to know which event loop to use
for which backend. This approach fails for both the new builtin
cairo-based backends (which do not appear in the table), and for
third-party backends (e.g. mplcairo).
mplcairo has used some custom code to patch that table for a while;
reuse it to more generally use the new "required_interactive_framework"
attribute.
Note that this PR suggests that there should be a better way to go back
from the canvas class to the backend module (rather than looking for
`sys.modules[cls.__module__].required_interactive_framework`, which is a
bit hacky and could in theory fail if the canvas class is actually
defined in another submodule).1 parent 9221a55 commit 1254075
1 file changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
1564 | 1566 | | |
1565 | 1567 | | |
1566 | 1568 | | |
| 1569 | + | |
1567 | 1570 | | |
1568 | 1571 | | |
1569 | 1572 | | |
| |||
1580 | 1583 | | |
1581 | 1584 | | |
1582 | 1585 | | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
1583 | 1615 | | |
1584 | 1616 | | |
1585 | 1617 | | |
| |||
0 commit comments