Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | python mcextend_virtclass_handler () { |
| 2 | cls = e.data.getVar("BBEXTENDCURR") |
| 3 | variant = e.data.getVar("BBEXTENDVARIANT") |
| 4 | if cls != "mcextend" or not variant: |
| 5 | return |
| 6 | |
| 7 | override = ":virtclass-mcextend-" + variant |
| 8 | |
| 9 | e.data.setVar("PN", e.data.getVar("PN", False) + "-" + variant) |
| 10 | e.data.setVar("MCNAME", variant) |
| 11 | e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override) |
| 12 | } |
| 13 | |
| 14 | addhandler mcextend_virtclass_handler |
| 15 | mcextend_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" |
| 16 | |