Completed
Push — master ( 2b1567...aa9a3d )
by Daniel
08:37
created

ProviderManagerPlugin.__init__()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
1
class ProviderManagerPlugin:
2
3
    def __init__(self, plugin):
4
        self.plugin = plugin
5
        self.log = plugin.log
6
        self.app = plugin.app
7
8
    def register(self, name, instance, description):
9
        return self.app.web.providers.register(name, instance, description, self.plugin)
10
11
12
class ProviderManagerApplication:
13
    def __init__(self, app):
14
        self._providers = {}
15
        self.app = app
16
17
    def register(self, name, instance, description, plugin):
18
        if name not in self._providers.keys():
19
            self._providers[name] = Provider(name, instance, description, plugin)
20
21
22
class Provider:
23
    def __init__(self, name, instance, description, plugin):
24
        self.name = name
25
        self.instance = instance
26
        self.description = description
27
        self.plugin = plugin
28
29