[nvda-addons] Re: Registering an add-on as a com server

  • From: "Pranav Lal" <pranav.lal@xxxxxxxxx>
  • To: <nvda-addons@xxxxxxxxxxxxx>
  • Date: Wed, 13 Jul 2016 23:33:28 +0530

Hi James,

I am going to take my code out of the globalPlugin class and see what happens.
As of now, everything is in the single globalPlugin class. 

Pranav

-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx [mailto:nvda-addons-bounce@xxxxxxxxxxxxx]
On Behalf Of James Scholes
Sent: Wednesday, July 13, 2016 10:15 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Registering an add-on as a com server

Pranav Lal wrote:

In terms of registering the com server with windows, I need to use the 
name of the class. However, many add-ons share the name of the class. 
Is this going to be a problem or do I need to do something more complex?

All global plugins use the class name of GlobalPlugin, but you're not importing
any code from other global plugins.  So if you reference the name GlobalPlugin
in your source file, it will refer specifically to your subclassed GlobalPlugin,
and nothing else.

With that said, however, I'm not really convinced that putting a COM server
inside a GlobalPlugin is the best idea.  It is specific and complex enough that
it should probably just go in its own class.  Your GlobalPlugin will then only
be responsible for registering it on startup, and doing whatever else it needs
to do.

class COMServer(object):
        # COM server code

class GlobalPlugin(globalPluginHandler.GlobalPlugin):
        def __init__(self, *args, **kwargs):
                super(GlobalPlugin, self).__init__(*args, **kwargs)
                # register COM server
--
James Scholes
http://twitter.com/JamesScholes
----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.


Community addons are available from: http://addons.nvda-project.org To send a
message to the list: nvda-addons@xxxxxxxxxxxxx To change your list
settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting 
bugs. 

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: 
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

Other related posts: