Added a class to addon clients to add more namespaces
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import weakref
|
||||||
from datetime import date, datetime
|
from datetime import date, datetime
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from ..compat import string_types, quote_plus
|
from ..compat import string_types, quote_plus
|
||||||
@@ -77,3 +78,10 @@ class NamespacedClient(object):
|
|||||||
@property
|
@property
|
||||||
def transport(self):
|
def transport(self):
|
||||||
return self.client.transport
|
return self.client.transport
|
||||||
|
|
||||||
|
class AddonClient(NamespacedClient):
|
||||||
|
@classmethod
|
||||||
|
def infect_client(cls, client):
|
||||||
|
addon = cls(weakref.proxy(client))
|
||||||
|
setattr(client, cls.namespace, addon)
|
||||||
|
return client
|
||||||
|
|||||||
Reference in New Issue
Block a user