MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/xstudio / control_main

Function control_main

python/src/xstudio/cli/control.py:12–106  ·  view source on GitHub ↗

Do main function.

()

Source from the content-addressed store, hash-verified

10__version__ = xstudio.__version__
11
12def control_main():
13 """Do main function."""
14 retval = 0
15 parser = argparse.ArgumentParser(
16 description=__doc__ + " Controls xstudio.",
17 formatter_class=argparse.ArgumentDefaultsHelpFormatter
18 )
19
20 parser.add_argument(
21 "-s", "--session", action="store",
22 type=str,
23 help="Host name.",
24 default=None
25 )
26
27 parser.add_argument(
28 "-H", "--host", action="store",
29 type=str,
30 help="Host name.",
31 default=None
32 )
33
34 parser.add_argument(
35 "-p", "--port", action="store",
36 type=int,
37 help="Port.",
38 default=14441
39 )
40
41 parser.add_argument(
42 "-i", "--info", action="store_true",
43 help="Print connection info.",
44 default=False
45 )
46
47 parser.add_argument(
48 "-a", "--add-media", type=str, nargs="*", default=[],
49 help="Add media."
50 )
51
52 parser.add_argument(
53 "-d", "--debug", action="store_true",
54 help="More debug info.",
55 default=False
56 )
57
58 args = parser.parse_args()
59
60 if args.session:
61 m = RemoteSessionManager(remote_session_path())
62 s = m.find(args.session)
63 conn = Connection(debug=args.debug)
64 conn.connect_remote(s.host(), s.port.port())
65
66 elif args.host:
67 conn = Connection(debug=args.debug)
68 conn.connect_remote(args.host, args.port)
69 else:

Callers 1

xstudio_control.pyFile · 0.90

Calls 14

findMethod · 0.95
connect_remoteMethod · 0.95
disconnectMethod · 0.95
ConnectionClass · 0.90
remote_session_pathFunction · 0.85
parse_argsMethod · 0.80
media_sourceMethod · 0.80
exitMethod · 0.80
hostMethod · 0.45
portMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected