Method: rich.console.Console.set_live
Calls: 24, Exceptions: 1, Paths: 2Back
Path 1: 23 calls (0.96)
Live (23)
1def set_live(self, live: "Live") -> None:
2 """Set Live instance. Used by Live context manager.
3
4 Args:
5 live (Live): Live instance using this Console.
6
7 Raises:
8 errors.LiveError: If this Console has a Live context currently active.
9 """
10 with self._lock:
11 if self._live is not None:
12 raise errors.LiveError("Only one live display may be active at once")
13 self._live = live
Path 2: 1 calls (0.04)
Live (1)
LiveError (1)
1def set_live(self, live: "Live") -> None:
2 """Set Live instance. Used by Live context manager.
3
4 Args:
5 live (Live): Live instance using this Console.
6
7 Raises:
8 errors.LiveError: If this Console has a Live context currently active.
9 """
10 with self._lock:
11 if self._live is not None:
12 raise errors.LiveError("Only one live display may be active at once")
13 self._live = live