style: apply ruff format to all source files
This commit is contained in:
@@ -15,7 +15,9 @@ from .base import Formatter
|
||||
class ODTFormatter(Formatter):
|
||||
"""Форматтер для экспорта в ODT."""
|
||||
|
||||
def __init__(self, author: str = "", from_date: str = "", to_date: str = "", **_kwargs):
|
||||
def __init__(
|
||||
self, author: str = "", from_date: str = "", to_date: str = "", **_kwargs
|
||||
):
|
||||
"""
|
||||
Инициализирует форматтер с параметрами для шапки отчета.
|
||||
"""
|
||||
@@ -28,7 +30,11 @@ class ODTFormatter(Formatter):
|
||||
Форматирует данные в объект OpenDocument.
|
||||
"""
|
||||
|
||||
with resources.files("redmine_reporter").joinpath("templates/template.odt").open("rb") as f:
|
||||
with (
|
||||
resources.files("redmine_reporter")
|
||||
.joinpath("templates/template.odt")
|
||||
.open("rb") as f
|
||||
):
|
||||
doc = load(f)
|
||||
|
||||
# Удаляем все текстовые параграфы из шаблона, оставляя только
|
||||
@@ -52,7 +58,9 @@ class ODTFormatter(Formatter):
|
||||
# Стиль ячеек
|
||||
cell_style_name = "TableCellStyle"
|
||||
cell_style = Style(name=cell_style_name, family="table-cell")
|
||||
cell_props = TableCellProperties(padding="0.04in", border="0.05pt solid #000000")
|
||||
cell_props = TableCellProperties(
|
||||
padding="0.04in", border="0.05pt solid #000000"
|
||||
)
|
||||
cell_style.addElement(cell_props)
|
||||
doc.automaticstyles.addElement(cell_style)
|
||||
|
||||
@@ -100,7 +108,9 @@ class ODTFormatter(Formatter):
|
||||
# в остальных — covered-cell для валидности ODF (#13)
|
||||
if first_version_in_project and first_row_in_version:
|
||||
cell_project = TableCell(stylename=cell_style_name)
|
||||
cell_project.setAttribute("numberrowsspanned", str(total_project_rows))
|
||||
cell_project.setAttribute(
|
||||
"numberrowsspanned", str(total_project_rows)
|
||||
)
|
||||
p = P(stylename=para_style_name, text=project)
|
||||
cell_project.addElement(p)
|
||||
row.addElement(cell_project)
|
||||
@@ -111,7 +121,9 @@ class ODTFormatter(Formatter):
|
||||
# в остальных — covered-cell для валидности ODF (#13)
|
||||
if first_row_in_version:
|
||||
cell_version = TableCell(stylename=cell_style_name)
|
||||
cell_version.setAttribute("numberrowsspanned", str(row_span_version))
|
||||
cell_version.setAttribute(
|
||||
"numberrowsspanned", str(row_span_version)
|
||||
)
|
||||
p = P(stylename=para_style_name, text=version)
|
||||
cell_version.addElement(p)
|
||||
row.addElement(cell_version)
|
||||
|
||||
Reference in New Issue
Block a user