Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -414,3 +414,55 @@ class SemapDocument:
|
||||
if self.books is not None:
|
||||
return [book.signature for book in self.books if book.has_signature]
|
||||
return []
|
||||
|
||||
|
||||
@dataclass
|
||||
class ELSA_Mono:
|
||||
authorName: str
|
||||
year: int
|
||||
signature: str
|
||||
page_from: int
|
||||
page_to: int
|
||||
edition: str | None = None
|
||||
|
||||
|
||||
@dataclass
|
||||
class ELSA_Journal:
|
||||
authorName: str
|
||||
year: int
|
||||
issue: str
|
||||
page_from: int
|
||||
page_to: int
|
||||
journal_title: str
|
||||
article_title: str
|
||||
signature: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class Person:
|
||||
firstName: str
|
||||
lastName: str
|
||||
personTitle: str | None = None
|
||||
|
||||
@property
|
||||
def fullName_LNFN(self) -> str:
|
||||
return f"{self.lastName}, {self.firstName}"
|
||||
|
||||
|
||||
@dataclass
|
||||
class ELSA_Editorial:
|
||||
# TODO: add dataclass fields
|
||||
pass
|
||||
|
||||
|
||||
@dataclass
|
||||
class ELSADocument:
|
||||
mail: str = None
|
||||
personTitle: str = None
|
||||
personName: Optional[str] = None
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""."""
|
||||
self.mail = self.mail.strip() if self.mail else None
|
||||
self.personTitle = self.personTitle.strip() if self.personTitle else None
|
||||
self.personName = self.personName.strip() if self.personName else None
|
||||
|
||||
Reference in New Issue
Block a user