style: reformat files with ruff

This commit is contained in:
Tim Grelka
2025-07-03 17:58:29 +02:00
parent d28845aac1
commit f0299298a6
8 changed files with 21 additions and 22 deletions
+6 -6
View File
@@ -27,7 +27,7 @@ class FiftyOhmLaTeXRenderer(LaTeXRenderer):
Question,
Picture,
Photo,
Table
Table,
)
self.question_renderer = question_renderer
@@ -105,7 +105,7 @@ class FiftyOhmLaTeXRenderer(LaTeXRenderer):
\captionof{{figure}}{{{text}}}
\label{{{ref}}}"""
def render_picture(self, token) :
def render_picture(self, token):
return self.render_picture_helper(token.id, token.ref, token.text, token.number)
@staticmethod
@@ -114,13 +114,13 @@ class FiftyOhmLaTeXRenderer(LaTeXRenderer):
\captionof{{figure}}{{{text}}}
\label{{{ref}}}"""
def render_photo(self, token) :
def render_photo(self, token):
return self.render_photo_helper(token.id, token.ref, token.text, token.number)
def render_table(self, token):
alignments = token.alignment
align = ""
for alignment in alignments :
for alignment in alignments:
align += alignment
table = f"\\begin{{DARCtabular}}{{{align}}}\n"
@@ -130,10 +130,10 @@ class FiftyOhmLaTeXRenderer(LaTeXRenderer):
table += self.render_inner(cell)
if j < len(row.children) - 1:
table += " & "
table += r"\\"+ "\n"
table += r"\\" + "\n"
table += "\\end{DARCtabular}"
if token.caption != "" :
if token.caption != "":
table += f"\\captionof{{figure}}{{{token.caption}}}\n"
table += f"\\label{{{token.name}}}\n"
+2 -2
View File
@@ -15,8 +15,8 @@ class Include(BlockToken):
@classmethod
def read(cls, lines):
re.compile(r'')
line = next(lines) # Consume the line with the include directive
re.compile(r"")
line = next(lines) # Consume the line with the include directive
ident = re.match(r"^\s*\[include:\s*([^\]]+)\]", line).group(1)
return ident
+1 -1
View File
@@ -87,4 +87,4 @@ class Morse(SpanToken):
return result
parse_inner = False
pattern = re.compile(r'\[morse:\s*([^\]]+)\]')
pattern = re.compile(r"\[morse:\s*([^\]]+)\]")
+1
View File
@@ -25,6 +25,7 @@ class Qso(BlockToken):
def __init__(self, match):
self.children = match
class QsoLine(BlockToken):
@classmethod
def parse_line(cls, line):