MCPcopy
hub / github.com/brightio/penelope / do_run

Method do_run

penelope.py:1206–1230  ·  view source on GitHub ↗

[module name] Run a module. Run 'help run' to view the available modules

(self, line)

Source from the content-addressed store, hash-verified

1204
1205 @session_operation(current=True)
1206 def do_run(self, line):
1207 """
1208 [module name]
1209 Run a module. Run 'help run' to view the available modules
1210 """
1211 try:
1212 parts = line.split(" ", 1)
1213 module_name = parts[0]
1214 except AttributeError:
1215 module_name = None
1216 print()
1217 cmdlogger.warning(paint("Select a module").YELLOW_white)
1218
1219 if module_name:
1220 module = modules().get(module_name)
1221 if module:
1222 args = parts[1] if len(parts) == 2 else ''
1223 if module.enabled:
1224 module.run(core.sessions[self.sid], args)
1225 else:
1226 cmdlogger.warning(f"Module '{module_name}' is disabled")
1227 else:
1228 cmdlogger.warning(f"Module '{module_name}' does not exist")
1229 else:
1230 self.show_modules()
1231
1232 @session_operation(current=True)
1233 def do_spawn(self, line):

Callers 1

runMethod · 0.80

Calls 5

show_modulesMethod · 0.95
paintClass · 0.85
modulesFunction · 0.85
getMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected