mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
Merge pull request #2931 from cortesi/scriptpath
script.run takes a path argument
This commit is contained in:
commit
9016608486
@ -12,6 +12,7 @@ from mitmproxy import flow
|
|||||||
from mitmproxy import command
|
from mitmproxy import command
|
||||||
from mitmproxy import eventsequence
|
from mitmproxy import eventsequence
|
||||||
from mitmproxy import ctx
|
from mitmproxy import ctx
|
||||||
|
import mitmproxy.types as mtypes
|
||||||
|
|
||||||
|
|
||||||
def load_script(path: str) -> types.ModuleType:
|
def load_script(path: str) -> types.ModuleType:
|
||||||
@ -110,7 +111,7 @@ class ScriptLoader:
|
|||||||
self.is_running = True
|
self.is_running = True
|
||||||
|
|
||||||
@command.command("script.run")
|
@command.command("script.run")
|
||||||
def script_run(self, flows: typing.Sequence[flow.Flow], path: str) -> None:
|
def script_run(self, flows: typing.Sequence[flow.Flow], path: mtypes.Path) -> None:
|
||||||
"""
|
"""
|
||||||
Run a script on the specified flows. The script is loaded with
|
Run a script on the specified flows. The script is loaded with
|
||||||
default options, and all lifecycle events for each flow are
|
default options, and all lifecycle events for each flow are
|
||||||
|
Loading…
Reference in New Issue
Block a user