Add plugin interface version

External plugins need to know which plugin interface is being
used by the host OSC.  Releases <1.6 (?) will not have a
version defined.

Plugins can add the following to their make_client() to discover
the interface version:

    _plugin_interface_version = getattr(
        instance,
        "PLUGIN_INTERFACE_VERSION",
        None,
    )

Change-Id: Ifc0f40fec5bc27f6425139984936b7f6e032a580
This commit is contained in:
Dean Troyer 2015-07-22 10:51:07 -05:00
parent b3335b3474
commit 15fe0fae17

View File

@ -48,6 +48,10 @@ class ClientCache(object):
class ClientManager(object): class ClientManager(object):
"""Manages access to API clients, including authentication.""" """Manages access to API clients, including authentication."""
# A simple incrementing version for the plugin to know what is available
PLUGIN_INTERFACE_VERSION = "2"
identity = ClientCache(identity_client.make_client) identity = ClientCache(identity_client.make_client)
def __getattr__(self, name): def __getattr__(self, name):