MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / main_cli

Function main_cli

python/inputmodule/cli.py:70–384  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68
69
70def main_cli():
71 parser = argparse.ArgumentParser()
72 parser.add_argument(
73 "-l", "--list", help="List all compatible devices", action="store_true"
74 )
75 parser.add_argument(
76 "--bootloader",
77 help="Jump to the bootloader to flash new firmware",
78 action="store_true",
79 )
80 parser.add_argument(
81 "--sleep",
82 help="Simulate the host going to sleep or waking up",
83 action=argparse.BooleanOptionalAction,
84 )
85 parser.add_argument(
86 "--is-sleeping", help="Check current sleep state", action="store_true"
87 )
88 parser.add_argument(
89 "--brightness", help="Adjust the brightness. Value 0-255", type=int
90 )
91 parser.add_argument(
92 "--get-brightness", help="Get current brightness", action="store_true"
93 )
94 parser.add_argument(
95 "--animate",
96 action=argparse.BooleanOptionalAction,
97 help="Start/stop vertical scrolling",
98 )
99 parser.add_argument(
100 "--get-animate", action="store_true", help="Check if currently animating"
101 )
102 parser.add_argument(
103 "--pwm",
104 help="Adjust the PWM frequency. Value 0-255",
105 type=int,
106 choices=[29000, 3600, 1800, 900],
107 )
108 parser.add_argument(
109 "--get-pwm", help="Get current PWM Frequency", action="store_true"
110 )
111 parser.add_argument(
112 "--pattern", help="Display a pattern", type=str, choices=PATTERNS
113 )
114 parser.add_argument(
115 "--image",
116 help="Display a PNG or GIF image in black and white only)",
117 type=argparse.FileType("rb"),
118 )
119 parser.add_argument(
120 "--image-grey",
121 help="Display a PNG or GIF image in greyscale",
122 type=argparse.FileType("rb"),
123 )
124 parser.add_argument(
125 "--camera", help="Stream from the webcam", action="store_true")
126 parser.add_argument("--video", help="Play a video", type=str)
127 parser.add_argument(

Callers 1

cli.pyFile · 0.85

Calls 15

bootloaderFunction · 0.90
send_commandFunction · 0.90
brightnessFunction · 0.90
get_brightnessFunction · 0.90
pwm_freqFunction · 0.90
get_pwm_freqFunction · 0.90
percentageFunction · 0.90
patternFunction · 0.90
animateFunction · 0.90
get_animateFunction · 0.90
image_blFunction · 0.90
image_greyscaleFunction · 0.90

Tested by

no test coverage detected