Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions opendbc/can/dbc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import re
import os
from dataclasses import dataclass
from collections.abc import Callable
from dataclasses import dataclass
from functools import cache

from opendbc import DBC_PATH

Expand Down Expand Up @@ -73,14 +74,8 @@ class Val:
VAL_SPLIT_RE = re.compile(r'["]+')


@dataclass
@cache
class DBC:
name: str
msgs: dict[int, Msg]
addr_to_msg: dict[int, Msg]
name_to_msg: dict[str, Msg]
vals: list[Val]

def __init__(self, name: str):
dbc_path = name
if not os.path.exists(dbc_path):
Expand Down