Drop lots of legacy code. Support Python 3.7-3.11.
[librarian.git] / src / librarian / meta / types / text.py
1 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
3 #
4 from .base import MetaValue
5
6
7 class TextValue(MetaValue, str):
8     @classmethod
9     def from_text(cls, text):
10         return cls(str(text))
11
12     def __str__(self):
13         return self.value
14
15
16
17 class NameIdentifier(TextValue):
18     has_language = False
19
20
21 class LegimiCategory(NameIdentifier):
22     pass
23
24
25 class ThemaCategory(NameIdentifier):
26     pass
27
28
29 class Epoch(NameIdentifier):
30     pass
31
32
33 class Kind(NameIdentifier):
34     pass
35
36
37 class Genre(NameIdentifier):
38     pass
39
40
41 class Audience(NameIdentifier):
42     pass