comparison sat/memory/encryption.py @ 2749:4b8271399f67

core (memory/encryption): added getNamespaces method to retrieve all plugins namespaces
author Goffi <goffi@goffi.org>
date Fri, 04 Jan 2019 11:14:17 +0100
parents da59ff099b32
children 1fa615faec8b
comparison
equal deleted inserted replaced
2748:ec9445c04a36 2749:4b8271399f67
101 return next(p for p in cls.plugins if p.namespace == namespace) 101 return next(p for p in cls.plugins if p.namespace == namespace)
102 except StopIteration: 102 except StopIteration:
103 raise exceptions.NotFound(_( 103 raise exceptions.NotFound(_(
104 u"Can't find requested encryption plugin: {namespace}").format( 104 u"Can't find requested encryption plugin: {namespace}").format(
105 namespace=namespace)) 105 namespace=namespace))
106
107 @classmethod
108 def getNamespaces(cls):
109 """Get available plugin namespaces"""
110 return {p.namespace for p in cls.getPlugins()}
106 111
107 @classmethod 112 @classmethod
108 def getNSFromName(cls, name): 113 def getNSFromName(cls, name):
109 """Retrieve plugin namespace from its name 114 """Retrieve plugin namespace from its name
110 115