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

ServerManagerPlugin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 4 1
A register() 0 2 1
1
class ServerManagerPlugin:
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, description):
9
        return self.app.web.server.register(name, description, self.plugin)
10
11
12
class ServerManagerApplication:
13
    def __init__(self, app):
14
        self._servers = {}
15
        self.app = app
16
17
    def register(self, name, description, plugin):
18
        if name not in self._servers.keys():
19
            self._servers[name] = Server(name, description, plugin)
20
21
22
class Server:
23
    def __init__(self, name, start, description, plugin):
24
        self.name = name
25
        self.start = start
26
        self.description = description
27
        self.plugin = plugin
28