Config: Report author name
This commit is contained in:
@@ -6,9 +6,15 @@ from odf.text import P
|
||||
from odf.table import Table, TableColumn, TableRow, TableCell
|
||||
|
||||
from .formatter import get_version, hours_to_human, STATUS_TRANSLATION
|
||||
from .utils import get_month_name_from_range
|
||||
|
||||
|
||||
def format_odt(issue_hours: List[Tuple[Issue, float]]) -> "OpenDocument":
|
||||
def format_odt(
|
||||
issue_hours: List[Tuple[Issue, float]],
|
||||
author: str = "",
|
||||
from_date: str = "",
|
||||
to_date: str = ""
|
||||
) -> "OpenDocument":
|
||||
template_path = "template.odt"
|
||||
if not os.path.exists(template_path):
|
||||
raise FileNotFoundError("Шаблон template.odt не найден...")
|
||||
@@ -17,7 +23,8 @@ def format_odt(issue_hours: List[Tuple[Issue, float]]) -> "OpenDocument":
|
||||
para_style_name = "Standard"
|
||||
|
||||
# Заголовок
|
||||
header_text = "Кокос Артём Николаевич. Отчет за месяц Июль."
|
||||
month_name = get_month_name_from_range(from_date, to_date)
|
||||
header_text = f"{author}. Отчет за месяц {month_name}."
|
||||
header_paragraph = P(stylename=para_style_name, text=header_text)
|
||||
doc.text.addElement(header_paragraph)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user