File: test_controls.py

package info (click to toggle)
colored 2.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 240 kB
  • sloc: python: 2,064; makefile: 4
file content (32 lines) | stat: -rw-r--r-- 602 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import time
from colored.controls import Controls


def main():

    moves: dict = {
        'down': 10,
        'up': 7,
        'right': 20,
        'left': 5,
        'previous': 10,
        'horizontal': 5,
        'erase_display': 2,
        'erase_line': 5,
        'scroll_up': 3,
        'scroll_down': 10
    }

    control = Controls()
    for move, row in moves.items():
        print(f'{move} {control.nav(move, row)}')
        time.sleep(1)

    print(f"position 4, 5 {control.nav('position', 4, 5)}")


if __name__ == '__main__':
    main()