~mapperr/trl

ref: 201aa0f23999fb5fa2a66084dd996188d96e57a7 trl/trullo/trl_label.py -rw-r--r-- 506 bytes
201aa0f2 — mapperr Print board labels 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from typing import Dict, Optional

import attr

from trullo.normalizer import Normalizer
from trullo.shortcuttable import Shortcuttable


@attr.s(auto_attribs=True)
class TrlLabel(Shortcuttable):
    id: str
    name: str
    raw_data: Dict
    color: Optional[str] = attr.ib(default=None)

    def get_normalized_name(self) -> str:
        return Normalizer.normalize(
            f"{self.raw_data['name']}"
            f"{self.color if self.color is not None else ''}"
            f"{self.id}"
        )