Support #5254
closedAPI: Support with a string.
0%
Description
So, i am playing a little with the API.
https://adiirc.github.io/apiv2/generated/html/28bb9111-568e-b9e8-3164-190fd013a6e2.htm
I am having issue with this:
https://docs.google.com/document/d/1kPiqRGoa5g9lvcPBxIn4S1TwWy_IMRgu2Z55RC2_NMs/edit?usp=sharing
It returns:
https://docs.google.com/document/d/1TBQ_9OrWiWZJcvZFa5XlAPxLDW8RxBhIm6arsqU2T3c/edit?usp=sharing
Also, i suppose "IPluginHost" must always get converted to "pluginHost" in the current version of the API ?
https://adiirc.github.io/apiv2/generated/html/56c5ff5d-e1b5-964c-d3a5-0960367c4abb.htm
Updated by Per Amundsen almost 4 years ago
It looks like you are trying to use the pywrapper, I would not recommend that. After I made it, I discovered that converting between python and .net objects is incredible hard so you are basically doing .NET with python syntax but can't use all the great python features and frameworks.
Somebody wrote this great guide for how it's done in C# https://github.com/AdiIRC/apiv2/tree/master/docs/tutorial-
I'm gonna delete all the wrappers since they are not use-able in the current form.
To answer the question, you are suppose to do pluginHost.ActiveIWindow.RealWindowName, pluginHost.ActiveIWindow is derived from the IWindow interface, can't use interfaces directly, they are just meta descriptions that describes the available variables, functions and properties.
Updated by Cassio Luz S. almost 4 years ago
I see.
Same rule is valid for ITools, IServer, etc?
Updated by Per Amundsen almost 4 years ago
yes, you can't use I<anything> directly, only the instances derived from them.
For e.g IServer, there is typically a parameter for a event that contains a "server" instance which is derived from IServer which you interact it, or you can enumerate or retrieve a server instance from the pluginHost.GetServers() API.
There is a global instance of ITools in pluginHost.Tools, not sure if it works with the pywrapper, it definitely works in C#.
Something like this: pluginHost.Tools.Debug("hello world");