Here is the situation:
I have an XML file with the menu hiearchy for my app in it. I can display the menu, but defining the callbacks in the XML file only returns strings.
The more defined problem:
I need a way to callback functions via a string. Yeah, there’s the
lambda x: pass
deal, but I’m not really sure that’s what I need.
From the comments to your question I understand that you’d like to do something like:
In this case
eval_dottedname()function could be implemented as:A better approach would be to limit string callbacks to simple identifiers and use a dispatch table like stdlib’s
cmdmodule: