MCPcopy Create free account
hub / github.com/ipython/traitlets / print

Method print

examples/argcomplete_app.py:106–119  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

104 skip_if_missing = Bool(False, help="Skip variable if not set").tag(config=True)
105
106 def print(self):
107 for env_var in self.vars:
108 if env_var not in os.environ:
109 if self.skip_if_missing:
110 continue
111 raise KeyError(f"Environment variable not set: {env_var}")
112
113 value = os.environ[env_var]
114 if self.style == "posix":
115 print(f"{env_var}={value}")
116 elif self.style == "verbose":
117 print(f">> key: {env_var} value:\n{value}\n")
118 elif self.style == "ndjson":
119 JsonPrinter(parent=self).print({"key": env_var, "value": value})
120
121
122def bool_flag(trait, value=True):

Callers

nothing calls this directly

Calls 2

JsonPrinterClass · 0.85
printMethod · 0.45

Tested by

no test coverage detected