MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / dump_dicts

Function dump_dicts

mitmproxy/optmanager.py:503–523  ·  view source on GitHub ↗

Dumps the options into a list of dict object. Return: A list like: { "anticache": { type: "bool", default: false, value: true, help: "help text"} }

(opts, keys: Iterable[str] | None = None)

Source from the content-addressed store, hash-verified

501
502
503def dump_dicts(opts, keys: Iterable[str] | None = None) -> dict:
504 """
505 Dumps the options into a list of dict object.
506
507 Return: A list like: { "anticache": { type: "bool", default: false, value: true, help: "help text"} }
508 """
509 options_dict = {}
510 if keys is None:
511 keys = opts.keys()
512 for k in sorted(keys):
513 o = opts._options[k]
514 t = typecheck.typespec_to_str(o.typespec)
515 option = {
516 "type": t,
517 "default": o.default,
518 "value": o.current(),
519 "help": o.help,
520 "choices": o.choices,
521 }
522 options_dict[k] = option
523 return options_dict
524
525
526def parse(text):

Callers

nothing calls this directly

Calls 2

keysMethod · 0.45
currentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…