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

ProviderManagerApplication   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 2
A __init__() 0 3 1
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