Coding style
- Use staticmethod where possible.
This commit is contained in:
parent
2e96cede00
commit
5b2021c132
2 changed files with 4 additions and 2 deletions
|
|
@ -165,7 +165,8 @@ class DiffEditor:
|
||||||
with contextlib.suppress(AttributeError):
|
with contextlib.suppress(AttributeError):
|
||||||
del self.diff
|
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:
|
if opcode == change_opcode:
|
||||||
for index in range(start, end):
|
for index in range(start, end):
|
||||||
appearance[index] = highlight_str(appearance[index], (0, 200, 0), 0.6)
|
appearance[index] = highlight_str(appearance[index], (0, 200, 0), 0.6)
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,9 @@ class Text:
|
||||||
def get_text(self):
|
def get_text(self):
|
||||||
return "\n".join(self)
|
return "\n".join(self)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
@functools.lru_cache(maxsize=5000)
|
@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)
|
return expand_str(line).ljust(max_line_length)
|
||||||
|
|
||||||
def appearance(self):
|
def appearance(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue