File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 1- # Import the basic framework components.
1+ import argparse
2+
23from softioc import asyncio_dispatcher , builder , softioc
34
45# Create an asyncio dispatcher, the event loop is now running
2425builder .LoadDatabase ()
2526softioc .iocInit (dispatcher )
2627
27- # Finally leave the IOC running with an interactive shell.
28- # softioc.interactive_ioc(globals())
29- softioc .non_interactive_ioc ()
28+ if __name__ == "__main__" :
29+ parser = argparse .ArgumentParser (
30+ description = "Simulated IOC for testing save-and-restore service" ,
31+ )
32+
33+ parser .add_argument (
34+ "--interactive" ,
35+ "-i" ,
36+ dest = "interactive" ,
37+ action = "store_true" ,
38+ help = "Start the IOC with interactive shell" ,
39+ )
40+
41+ args = parser .parse_args ()
42+ if args .interactive :
43+ softioc .interactive_ioc (globals ())
44+ else :
45+ softioc .non_interactive_ioc ()
You can’t perform that action at this time.
0 commit comments