File: opts.py

package info (click to toggle)
python-bellows 0.40.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 992 kB
  • sloc: python: 13,630; sh: 7; makefile: 4
file content (92 lines) | stat: -rw-r--r-- 1,964 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import os

import click

from . import util

CHANNELS = list(range(11, 27))

channel = click.option(
    "-c", "--channel", type=click.IntRange(11, 26), required=True, default=15
)

channels = click.option(
    "-C",
    "--channels",
    type=util.CSVParamType(11, 26),
    metavar="CHANNELS",
    default=",".join(map(str, CHANNELS)),
    show_default=True,
)

device = click.option(
    "-d", "--device", type=click.STRING, envvar="EZSP_DEVICE", required=True
)

baudrate = click.option(
    "-b", "--baudrate", type=click.INT, envvar="EZSP_BAUDRATE", default=57600
)

database_file = click.option(
    "-D",
    "--database",
    type=click.Path(exists=True, dir_okay=False, writable=True),
    required=True,
    default=os.path.join(click.get_app_dir("bellows"), "app.db"),
)

duration_ms = click.option(
    "-t",
    "--duration",
    "duration_ms",
    type=click.INT,
    metavar="MILLISECONDS",
    default=50,
    show_default=True,
)

duration_s = click.option(
    "-t",
    "--duration",
    "duration_s",
    type=click.INT,
    metavar="SECONDS",
    default=30,
    show_default=True,
)

extended_pan = click.option("-E", "--extended-pan-id", type=click.STRING)

flow_control = click.option(
    "--flow-control",
    default="software",
    type=click.Choice(["hardware", "software", "none"], case_sensitive=False),
    envvar="EZSP_FLOW_CONTROL",
    help="use hardware flow control",
)

pan = click.option("-P", "--pan-id", type=click.IntRange(0, 65535))

manufacturer = click.option(
    "-m",
    "--manufacturer",
    type=click.IntRange(0, 0xFFFF),
    default=None,
    help="send a manufacturer specific command",
)

network_key = click.option(
    "-N",
    "--network-key",
    type=util.CSVParamType(0, 255),
    default=None,
    help="16 bytes of network key, lsb first",
)

network_key_seq = click.option(
    "-s",
    "--network-key-seq",
    type=click.IntRange(0, 255),
    default=0,
    help="Network key sequence number",
)