Skip to content

Commit

Permalink
Score gets its own repr (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephine-wolf-oberholtzer authored Feb 28, 2025
1 parent 47b541a commit 549194c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 0 additions & 4 deletions supriya/contexts/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import dataclasses
import itertools
import re
import shlex
import threading
from os import PathLike
from typing import (
Expand Down Expand Up @@ -233,9 +232,6 @@ def __getstate__(self):
del state["_thread_local"]
return state

def __repr__(self) -> str:
return f"<{type(self).__name__} {self.boot_status.name} [{shlex.join(self.options)}]>"

def __setstate__(self, state):
self.__dict__.update(state)
self._lock = threading.RLock()
Expand Down
5 changes: 5 additions & 0 deletions supriya/contexts/nonrealtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import hashlib
import logging
import platform
import shlex
import shutil
import struct
from contextlib import ExitStack
Expand Down Expand Up @@ -58,6 +59,10 @@ async def __render__(
**kwargs,
)

def __repr__(self) -> str:
options = dataclasses.replace(self.options, realtime=False)
return f"<{type(self).__name__} [{shlex.join(options)} -N ...]>"

### PRIVATE METHODS ###

def _free_id(
Expand Down
4 changes: 4 additions & 0 deletions supriya/contexts/realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import asyncio
import concurrent.futures
import logging
import shlex
import threading
import warnings
from collections.abc import Sequence as SequenceABC
Expand Down Expand Up @@ -187,6 +188,9 @@ def __contains__(self, object_: ContextObject) -> bool:
return True
return False

def __repr__(self) -> str:
return f"<{type(self).__name__} {self.boot_status.name} [{shlex.join(self.options)}]>"

### PRIVATE METHODS ###

def _add_node_to_children(
Expand Down

0 comments on commit 549194c

Please sign in to comment.