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.system()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
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