Skip to content

Commit f3ec3f8

Browse files
committed
Spectacular AI CLI structure (Python)
1 parent 801f936 commit f3ec3f8

File tree

6 files changed

+26
-0
lines changed

6 files changed

+26
-0
lines changed

python/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__pycache__
2+
*.pyc

python/cli/__init__.py

Whitespace-only changes.

python/cli/process/__init__.py

Whitespace-only changes.

python/cli/record/__init__.py

Whitespace-only changes.

python/cli/record/record.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Record data from a device attached to this computer"""
2+
3+
from .oak import define_subparser as define_subparser_oak
4+
5+
def define_subparser(subparsers):
6+
sub = subparsers.add_parser('record', help=__doc__.strip())
7+
device_subparsers = sub.add_subparsers(title='device', dest='device', required=True)
8+
define_subparser_oak(device_subparsers)
9+
return sub

python/cli/sai_cli.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import argparse
2+
3+
from process.process import define_subparser as process_define_subparser
4+
from record.record import define_subparser as record_define_subparser
5+
6+
def parse_args():
7+
parser = argparse.ArgumentParser(description='Spectacular AI command line tool')
8+
subparsers = parser.add_subparsers(title='subcommands', dest='subcommand', required=True)
9+
process_define_subparser(subparsers)
10+
record_define_subparser(subparsers)
11+
return parser.parse_args()
12+
13+
if __name__ == '__main__':
14+
args = parse_args()
15+
args.func(args)

0 commit comments

Comments
 (0)