Would it be possible for Plugins to have "public" classes for the main Script namespace to utilize? The CallPlugin method is rather limited and having plugins support classes would give the advantage of easy distribution and the ease of the Scripting languages for coding extensible features.
Exposing Classes from Plugins
Posted by WillFa on Wed 13 Aug 2003 11:28 AM — 3 posts, 9,851 views.
Example, please?
I've written/adapted a spellchecking class in Python that's scriptable and more flexible than Wintertree's implementation. What I'd like to do is throw that in a plug in, and have the world's script file be able to do something like Plugins[Pluginname].Check("string") or PyPMSC.Check("String") (the class name), listvar = PyPMSC.Suggestions(), PyPMSC.CustomDicts = [r"C:\foo1.txt", r"C:\Foo2.txt"] etc.
I use this module in other places, so writing the plugin to overload the functions to accept a string to Eval, or setting World.SetVariable is klugey and makes the syntax difficult for others to use.
similarly to how you register IMushClient as a Named Item in the Script file's name space, would it be possible to do the same for public classes in a plugin.
I use this module in other places, so writing the plugin to overload the functions to accept a string to Eval, or setting World.SetVariable is klugey and makes the syntax difficult for others to use.
similarly to how you register IMushClient as a Named Item in the Script file's name space, would it be possible to do the same for public classes in a plugin.