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.

train_ramp   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 23
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A Train.run() 0 9 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A system() 0 2 1
1
import logging
2
3
from curio import sleep
4
from bricknil import attach, start
5
from bricknil.hub import PoweredUpHub
6
from bricknil.sensor import TrainMotor
7
from bricknil.process import Process
8
9
@attach(TrainMotor, name='motor')
10
class Train(PoweredUpHub):
11
12
    async def run(self):
13
        self.message_info("Running")
14
        for i in range(2):
15
            self.message_info('Increasing speed')
16
            await self.motor.ramp_speed(80,5000)
17
            await sleep(6)
18
            self.message_info('Coming to a stop')
19
            await self.motor.ramp_speed(0,1000) 
20
            await sleep(2)
21
22
async def system():
23
    train = Train('My train')
24
25
if __name__ == '__main__':
26
    logging.basicConfig(level=logging.INFO)
27
    start(system)
28