MCPcopy Create free account
hub / github.com/SpaceNetLab/StarryNet / __init__

Method __init__

starrynet/cli.py:43–57  ·  view source on GitHub ↗

Start and run interactive or batch mode CLI starrynet: Starrynet network object stdin: standard input for CLI script: script to run in batch mode

(self, starrynet, stdin=sys.stdin, *args, **kwargs)

Source from the content-addressed store, hash-verified

41 prompt = 'starrynet> '
42
43 def __init__(self, starrynet, stdin=sys.stdin, *args, **kwargs):
44 """Start and run interactive or batch mode CLI
45 starrynet: Starrynet network object
46 stdin: standard input for CLI
47 script: script to run in batch mode"""
48 self.sn = starrynet
49 # Local variable bindings for py command
50 self.locals = {'net': starrynet}
51 # Attempt to handle input
52 self.inPoller = poll()
53 self.inPoller.register(stdin)
54 Cmd.__init__(self, *args, stdin=stdin, **kwargs)
55 info('*** Starting CLI:\n')
56
57 self.run()
58
59 def run(self):
60 "Run our cmdloop(), catching KeyboardInterrupt"

Callers

nothing calls this directly

Calls 1

runMethod · 0.95

Tested by

no test coverage detected