summaryrefslogtreecommitdiff
path: root/tools/libdol2asm/data/module.py
blob: 000caaf3af526a12c5fcbc5e5083d67b7d3741d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

from typing import Dict, List
from dataclasses import dataclass, field
from .library import *
from .section import ExecutableSection

@dataclass
class Module:
    index: int
    libraries: Dict[str, Library] = field(default_factory=dict, repr=False)
    executable_sections: List[ExecutableSection] = field(
        default_factory=list, repr=False)

    def add_library(self, library: Library):
        self.libraries[library.name] = library

    @property
    def base_library(self):
        return next(iter(self.libraries.values()))