From ea2d76864da2448152428a62fe5c7daaea6ab0d3 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 21 Jul 2018 17:09:52 +0200 Subject: yapf -rip --- poezio/windows/base_wins.py | 4 +-- poezio/windows/bookmark_forms.py | 53 +++++++++++++++++++++------------------- poezio/windows/data_forms.py | 4 +-- poezio/windows/info_wins.py | 6 ++--- poezio/windows/inputs.py | 5 ++-- poezio/windows/list.py | 12 ++++----- poezio/windows/roster_win.py | 18 ++++++++------ 7 files changed, 53 insertions(+), 49 deletions(-) (limited to 'poezio/windows') diff --git a/poezio/windows/base_wins.py b/poezio/windows/base_wins.py index 41f6a761..eaedd82b 100644 --- a/poezio/windows/base_wins.py +++ b/poezio/windows/base_wins.py @@ -120,8 +120,8 @@ class Win: self._win.attron(attr_italic) if (attr_char in string.digits or attr_char == '-') and attr_char != '': - color_str = text[next_attr_char + 1:text.find( - '}', next_attr_char)] + color_str = text[next_attr_char + + 1:text.find('}', next_attr_char)] if ',' in color_str: tup, char = read_tuple(color_str) self._win.attron(to_curses_attr(tup)) diff --git a/poezio/windows/bookmark_forms.py b/poezio/windows/bookmark_forms.py index 25d4055d..5a319c27 100644 --- a/poezio/windows/bookmark_forms.py +++ b/poezio/windows/bookmark_forms.py @@ -184,8 +184,8 @@ class BookmarksWin(Win): BookmarkPasswordInput(bookmark), BookmarkAutojoinWin(bookmark), BookmarkMethodInput(bookmark))) - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_NORMAL_TEXT) self.current_horizontal_input = 0 self.current_input = len(self.lines) - 1 @@ -218,8 +218,8 @@ class BookmarksWin(Win): return if self.current_input == len(self.lines) - 1: return - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_NORMAL_TEXT) # Adjust the scroll position if the current_input would be outside # of the visible area @@ -238,8 +238,8 @@ class BookmarksWin(Win): return if self.current_input == 0: return - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_NORMAL_TEXT) self.current_input -= 1 # Adjust the scroll position if the current_input would be outside @@ -247,21 +247,21 @@ class BookmarksWin(Win): if self.current_input < self.scroll_pos: self.scroll_pos = self.current_input self.refresh() - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_SELECTED_ROW) def go_to_next_horizontal_input(self): if not self.lines: return - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_NORMAL_TEXT) self.current_horizontal_input += 1 if self.current_horizontal_input > 3: self.current_horizontal_input = 0 - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_SELECTED_ROW) def go_to_next_page(self): @@ -271,8 +271,8 @@ class BookmarksWin(Win): if self.current_input == len(self.lines) - 1: return - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_NORMAL_TEXT) inc = min(self.height, len(self.lines) - self.current_input - 1) @@ -294,8 +294,8 @@ class BookmarksWin(Win): if self.current_input == 0: return - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_NORMAL_TEXT) dec = min(self.height, self.current_input) @@ -305,8 +305,8 @@ class BookmarksWin(Win): if self.current_input < self.scroll_pos: self.scroll_pos = self.current_input self.refresh() - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_SELECTED_ROW) return True @@ -315,12 +315,12 @@ class BookmarksWin(Win): return if self.current_horizontal_input == 0: return - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_NORMAL_TEXT) self.current_horizontal_input -= 1 - self.lines[ - self.current_input][self.current_horizontal_input].set_color( + self.lines[self.current_input][ + self.current_horizontal_input].set_color( get_theme().COLOR_SELECTED_ROW) def on_input(self, key): @@ -336,9 +336,12 @@ class BookmarksWin(Win): for i in range(len(self.lines)): self.lines[i][0].resize(1, self.width // 4, y + 1, 0) self.lines[i][1].resize(1, self.width // 4, y + 1, self.width // 4) - self.lines[i][2].resize(1, self.width // 6, y + 1, 3 * self.width // 6) - self.lines[i][3].resize(1, self.width // 6, y + 1, 4 * self.width // 6) - self.lines[i][4].resize(1, self.width // 6, y + 1, 5 * self.width // 6) + self.lines[i][2].resize(1, self.width // 6, y + 1, + 3 * self.width // 6) + self.lines[i][3].resize(1, self.width // 6, y + 1, + 4 * self.width // 6) + self.lines[i][4].resize(1, self.width // 6, y + 1, + 5 * self.width // 6) y += 1 self._refresh() for i, inp in enumerate(self.lines): diff --git a/poezio/windows/data_forms.py b/poezio/windows/data_forms.py index d5ee29c5..dc954bd7 100644 --- a/poezio/windows/data_forms.py +++ b/poezio/windows/data_forms.py @@ -422,8 +422,8 @@ class FormWin: self.current_input += 1 jump = 0 while self.current_input + jump != len( - self.inputs) - 1 and self.inputs[self.current_input - + jump]['input'].is_dummy(): + self.inputs) - 1 and self.inputs[self.current_input + + jump]['input'].is_dummy(): jump += 1 if self.inputs[self.current_input + jump]['input'].is_dummy(): return diff --git a/poezio/windows/info_wins.py b/poezio/windows/info_wins.py index 2d4d1e01..27f9e1cf 100644 --- a/poezio/windows/info_wins.py +++ b/poezio/windows/info_wins.py @@ -228,9 +228,9 @@ class DynamicConversationInfoWin(ConversationInfoWin): self.addstr(jid.bare, to_curses_attr(get_theme().COLOR_CONVERSATION_NAME)) if jid.resource: - self.addstr("/%s" % (jid.resource, ), - to_curses_attr( - get_theme().COLOR_CONVERSATION_RESOURCE)) + self.addstr( + "/%s" % (jid.resource, ), + to_curses_attr(get_theme().COLOR_CONVERSATION_RESOURCE)) self.addstr('] ', to_curses_attr(get_theme().COLOR_INFORMATION_BAR)) diff --git a/poezio/windows/inputs.py b/poezio/windows/inputs.py index 6956f4f6..6453205c 100644 --- a/poezio/windows/inputs.py +++ b/poezio/windows/inputs.py @@ -522,9 +522,8 @@ class Input(Win): self._win.erase() if self.color: self._win.attron(to_curses_attr(self.color)) - displayed_text = text[self.view_pos: - self.view_pos + self.width - 1].replace( - '\t', '\x18') + displayed_text = text[self.view_pos:self.view_pos + self.width - + 1].replace('\t', '\x18') self._win.attrset(0) self._addstr_colored_lite(displayed_text) # Fill the rest of the line with the input color diff --git a/poezio/windows/list.py b/poezio/windows/list.py index 1f51e88f..26cb1e5f 100644 --- a/poezio/windows/list.py +++ b/poezio/windows/list.py @@ -101,9 +101,9 @@ class ListWin(Win): if not txt: continue if line is self.lines[self._selected_row]: - self.addstr(y, x, txt[:size], - to_curses_attr( - get_theme().COLOR_INFORMATION_BAR)) + self.addstr( + y, x, txt[:size], + to_curses_attr(get_theme().COLOR_INFORMATION_BAR)) else: self.addstr(y, x, txt[:size]) x += size @@ -192,9 +192,9 @@ class ColumnHeaderWin(Win): size = self._columns_sizes[col] txt += ' ' * (size - len(txt)) if col in self._column_sel: - self.addstr(0, x, txt, - to_curses_attr( - get_theme().COLOR_COLUMN_HEADER_SEL)) + self.addstr( + 0, x, txt, + to_curses_attr(get_theme().COLOR_COLUMN_HEADER_SEL)) else: self.addstr(0, x, txt, to_curses_attr(get_theme().COLOR_COLUMN_HEADER)) diff --git a/poezio/windows/roster_win.py b/poezio/windows/roster_win.py index 36c41ae6..f1490709 100644 --- a/poezio/windows/roster_win.py +++ b/poezio/windows/roster_win.py @@ -146,8 +146,8 @@ class RosterWin(Win): self.scroll_down(self.pos - self.start_pos - self.height + (self.height // 2)) # draw the roster from the cache - roster_view = self.roster_cache[self.start_pos - 1: - self.start_pos + self.height] + roster_view = self.roster_cache[self.start_pos - 1:self.start_pos + + self.height] options = { 'show_roster_sub': config.get('show_roster_subscriptions'), @@ -190,9 +190,10 @@ class RosterWin(Win): """ The header at the top """ - self.addstr('Roster: %s/%s contacts' % - (roster.get_nb_connected_contacts(), len(roster)), - to_curses_attr(get_theme().COLOR_INFORMATION_BAR)) + self.addstr( + 'Roster: %s/%s contacts' % (roster.get_nb_connected_contacts(), + len(roster)), + to_curses_attr(get_theme().COLOR_INFORMATION_BAR)) self.finish_line(get_theme().COLOR_INFORMATION_BAR) def draw_group(self, y, group, colored): @@ -206,9 +207,10 @@ class RosterWin(Win): else: self.addstr(y, 0, '[-] ') contacts = " (%s/%s)" % (group.get_nb_connected_contacts(), len(group)) - self.addstr(y, 4, - self.truncate_name(group.name, - len(contacts) + 4) + contacts) + self.addstr( + y, 4, + self.truncate_name(group.name, + len(contacts) + 4) + contacts) if colored: self._win.attroff(to_curses_attr(get_theme().COLOR_SELECTED_ROW)) self.finish_line() -- cgit v1.2.3