MCPcopy Index your code
hub / github.com/ipython/ipython / __init__

Method __init__

IPython/utils/PyColorize.py:402–425  ·  view source on GitHub ↗

Create a parser with a specified color table and output channel. Call format() to process code.

(self, out: Any = sys.stdout, *, theme_name: str | None = None)

Source from the content-addressed store, hash-verified

400 raw: str
401
402 def __init__(self, out: Any = sys.stdout, *, theme_name: str | None = None) -> None:
403 """Create a parser with a specified color table and output channel.
404
405 Call format() to process code.
406 """
407
408 assert theme_name is not None
409
410 self.out = out
411 self.pos = 0
412 self.lines = []
413 self.raw = ""
414 if theme_name is not None:
415 if theme_name in ["Linux", "LightBG", "Neutral", "NoColor"]:
416 warnings.warn(
417 f"Theme names and color schemes are lowercase in IPython 9.0 use {theme_name.lower()} instead",
418 DeprecationWarning,
419 stacklevel=2,
420 )
421 theme_name = theme_name.lower()
422 if not theme_name:
423 self.theme_name = "nocolor"
424 else:
425 self.theme_name = theme_name
426
427 @property
428 def theme_name(self) -> str:

Callers

nothing calls this directly

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected