From 45af588792d080996a2772d214324ace5f5b5cd5 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 18 Jan 2022 16:32:58 +1000 Subject: [PATCH] Coding style - Rename appearance to appearance_for. --- diff_edit/__init__.py | 6 +++--- diff_edit/editor.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/diff_edit/__init__.py b/diff_edit/__init__.py index 4b2b1f8..d98538d 100755 --- a/diff_edit/__init__.py +++ b/diff_edit/__init__.py @@ -332,7 +332,7 @@ class DiffEditor: line[-1] = "↓" return columns - def appearance(self, dimensions): + def appearance_for(self, dimensions): width, height = self.last_dimensions = dimensions if self.diff is None: self.update_diff() @@ -340,8 +340,8 @@ class DiffEditor: divider_width = 3 left_width = (width - divider_width) // 2 right_width = width - divider_width - left_width - left_appearance = self.left_editor.appearance((left_width, height)) - right_appearance = self.right_editor.appearance((right_width, height)) + left_appearance = self.left_editor.appearance_for((left_width, height)) + right_appearance = self.right_editor.appearance_for((right_width, height)) inactive_appearance = (right_appearance if self.left_editor is self.editors[0] else left_appearance) inactive_appearance[0] = highlight_str(inactive_appearance[0], termstr.Color.black, 0.5) diff --git a/diff_edit/editor.py b/diff_edit/editor.py index 75608d3..44a26d6 100755 --- a/diff_edit/editor.py +++ b/diff_edit/editor.py @@ -109,7 +109,7 @@ class Text: def appearance_min(self): return self.text - def appearance(self, dimensions): + def appearance_for(self, dimensions): return fill3.appearance_resize(self.appearance_min(), dimensions) @@ -141,8 +141,8 @@ class Decor: self.widget = widget self.decorator = decorator - def appearance(self, dimensions): - return self.decorator(self.widget.appearance(dimensions)) + def appearance_for(self, dimensions): + return self.decorator(self.widget.appearance_for(dimensions)) def appearance_min(self): return self.decorator(self.widget.appearance_min()) @@ -623,13 +623,13 @@ class Editor: return (termstr.TermStr(" " + path_part, self._HEADER_STYLE).bold() + termstr.TermStr(cursor_position + " ", self._HEADER_STYLE)) - def appearance(self, dimensions): + def appearance_for(self, dimensions): width, height = dimensions is_changed = self.text_widget.actual_text != self.original_text header = self.get_header(self.path, width, self.cursor_x, self.cursor_y, is_changed) self.last_width = width self.last_height = height - result = [header] + self.view_widget.appearance((width, height - 1)) + result = [header] + self.view_widget.appearance_for((width, height - 1)) return result KEY_MAP = {