GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 6f72c9...a6d1a2 )
by Benjamin
01:11
created

Pump.stop()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 2
rs 10
cc 1
1
import threading
2
3
4
class Network:
5
    def __init__(self, key=b'\x00' * 8, name=None):
6
        self.key = key
7
        self.name = name
8
        self.number = 0
9
10
    def __str__(self):
11
        return self.name + self.key
12
13
14
class Pump(threading.Thread):
15
    def __init__(self):
16
        super().__init__()
17
        self._stop = threading.Event()
18
19
    def stop(self):
20
        self._stop.set()
21
22
    def stopped(self):
23
        return self._stop.isSet()
24
25
    def run(self):
26
        pass
27
28
29
class Node:
30
    def __init__(self, driver, name=None):
31
        self._driver = driver
32
        self._name = name
33
        self.running = False
34
        self.pump = Pump()
35
36
    def __enter__(self):
37
        return self
38
39
    def __exit__(self, exc_type, exc_val, exc_tb):
40
        self.stop()
41
42
    def start(self):
43
        if not self.running:
44
            self.pump.start()
45
            self.running = True
46
47
    def stop(self):
48
        if self.running:
49
            self.pump.stop()
50
            self.pump.join()
51
            self.running = False
52
53
    def reset(self):
54
        pass
55
56
    def getCapabilities(self):
57
        pass
58
59
    def addEventListener(self, callback):
60
        pass
61