File: ipython.py

package info (click to toggle)
python-friendly 0.7.21%2Bgit20230418.fe5d3a2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,268 kB
  • sloc: python: 2,291; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 787 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Sets up everything required for an IPython terminal session."""
from friendly.ipython_common import excepthook
from friendly.ipython_common.settings import init_settings

from friendly import print_repl_header
from friendly import settings
from friendly_traceback import config
from friendly.rich_console_helpers import *  # noqa
from friendly.rich_console_helpers import __all__  # noqa

import colorama

colorama.deinit()  # Required to get correct colours in Windows terminal
colorama.init(convert=False, strip=False)

if settings.terminal_type:
    settings.ENVIRONMENT = settings.terminal_type + "-ipython"
else:
    settings.ENVIRONMENT = "ipython"

excepthook.enable()
init_settings("dark")
print_repl_header()
if config.did_exception_occur_before():
    friendly_tb()  # noqa