Reformat offlineimap/ui/Curses.py

Add some spaces, remove lines,... now format is better (lintian).
This commit is contained in:
Rodolfo García Peñas (kix) 2020-08-29 19:55:07 +02:00
parent 1df1a39b11
commit 1b385dfafb

View File

@ -99,6 +99,7 @@ class CursesUtil:
def lockedstuff(): def lockedstuff():
curses.panel.update_panels() curses.panel.update_panels()
curses.doupdate() curses.doupdate()
self.exec_locked(lockedstuff) self.exec_locked(lockedstuff)
def isactive(self): def isactive(self):
@ -142,6 +143,7 @@ class CursesAccountFrame:
self.window.addstr(0, 0, accstr) self.window.addstr(0, 0, accstr)
except curses.error as e: # Occurs when the terminal is very small except curses.error as e: # Occurs when the terminal is very small
pass pass
self.ui.exec_locked(addstr); self.ui.exec_locked(addstr);
self.location = len(accstr) self.location = len(accstr)
@ -191,6 +193,7 @@ class CursesAccountFrame:
self.account.config.set('Account %s' % self.account.name, self.account.config.set('Account %s' % self.account.name,
'skipsleep', '1') 'skipsleep', '1')
class CursesThreadFrame: class CursesThreadFrame:
"""curses_color: current color pair for logging.""" """curses_color: current color pair for logging."""
@ -222,6 +225,7 @@ class CursesThreadFrame:
except curses.error: # Occurs when the terminal is very small except curses.error: # Occurs when the terminal is very small
pass pass
self.window.refresh() self.window.refresh()
# lock the curses IO while fudging stuff # lock the curses IO while fudging stuff
self.ui.exec_locked(locked_display) self.ui.exec_locked(locked_display)
@ -330,6 +334,7 @@ class CursesLogHandler(logging.StreamHandler):
self.ui.unlock() self.ui.unlock()
self.ui.tframe_lock.release() self.ui.tframe_lock.release()
class Blinkenlights(UIBase, CursesUtil): class Blinkenlights(UIBase, CursesUtil):
"""Curses-cased fancy UI. """Curses-cased fancy UI.
@ -476,7 +481,7 @@ class Blinkenlights(UIBase, CursesUtil):
self.gettf().setcolor('white') self.gettf().setcolor('white')
super(Blinkenlights, self).callhook(*args) super(Blinkenlights, self).callhook(*args)
############ Generic logging functions ############################# # Generic logging functions #
def warn(self, msg, minor=0): def warn(self, msg, minor=0):
self.gettf().setcolor('red', curses.A_BOLD) self.gettf().setcolor('red', curses.A_BOLD)
super(Blinkenlights, self).warn(msg) super(Blinkenlights, self).warn(msg)
@ -670,4 +675,3 @@ class Blinkenlights(UIBase, CursesUtil):
def threadException(self, thread): def threadException(self, thread):
# self._log_con_handler.stop() # self._log_con_handler.stop()
UIBase.threadException(self, thread) UIBase.threadException(self, thread)