Coding style

- Use staticmethod where possible.
This commit is contained in:
Andrew Hamilton 2022-05-28 22:37:57 +10:00
parent 2e96cede00
commit 5b2021c132
2 changed files with 4 additions and 2 deletions

View file

@ -165,7 +165,8 @@ class DiffEditor:
with contextlib.suppress(AttributeError):
del self.diff
def _highlight_lines(self, appearance, start, end, opcode, change_opcode):
@staticmethod
def _highlight_lines(appearance, start, end, opcode, change_opcode):
if opcode == change_opcode:
for index in range(start, end):
appearance[index] = highlight_str(appearance[index], (0, 200, 0), 0.6)

View file

@ -118,8 +118,9 @@ class Text:
def get_text(self):
return "\n".join(self)
@staticmethod
@functools.lru_cache(maxsize=5000)
def _convert_line(self, line, max_line_length):
def _convert_line(line, max_line_length):
return expand_str(line).ljust(max_line_length)
def appearance(self):