MCPcopy
hub / github.com/RUB-NDS/PRET / do_load

Method do_load

printer.py:173–182  ·  view source on GitHub ↗

Run commands from file: load cmd.txt

(self, arg)

Source from the content-addressed store, hash-verified

171
172 # ------------------------[ load ]------------------------------------
173 def do_load(self, arg):
174 "Run commands from file: load cmd.txt"
175 if not arg:
176 arg = eval(input("File: "))
177 data = file().read(arg).decode() or ""
178 for cmd in data.splitlines():
179 # simulate command prompt
180 print((self.prompt + cmd))
181 # execute command with premcd
182 self.onecmd(self.precmd(cmd))
183
184 # ------------------------[ loop <cmd> <arg1> <arg2> … ]--------------
185 def do_loop(self, arg):

Callers 1

__init__Method · 0.95

Calls 4

onecmdMethod · 0.95
precmdMethod · 0.95
fileClass · 0.90
readMethod · 0.80

Tested by

no test coverage detected